Changeset 46
- Timestamp:
- Aug 9, 2010, 11:22:45 AM (14 years ago)
- Location:
- branches/DelphiToC
- Files:
-
- 2 added
- 1 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DelphiToC/Analyze/UPascalParser.pas
r45 r46 95 95 96 96 // Recovery: try to find nearest same code 97 while FNextToken <> Codedo97 while (FNextToken <> Code) and (FNextTokenType <> ttEndOfFile) do 98 98 GetNextToken; 99 99 end; … … 482 482 ErrorMessage(SUnknownIdentifier, [ReadCode]); 483 483 end; 484 end else begin 484 end else 485 if FNextToken = ';' then 486 else begin 485 487 Result := nil; 486 488 ErrorMessage(SIllegalExpression, [ReadCode]); … … 576 578 with SourceCode do begin 577 579 Expect('begin'); 578 while FNextToken <> 'end'do begin580 while (FNextToken <> 'end') and (FNextTokenType <> ttEndOfFile) do begin 579 581 Commands.Add(nil); 580 582 NewCommand := ParseCommand(CommonBlock); -
branches/DelphiToC/DelphiToC.lpi
r45 r46 31 31 </local> 32 32 </RunParams> 33 <RequiredPackages Count=" 1">33 <RequiredPackages Count="2"> 34 34 <Item1> 35 <PackageName Value="SynEdit"/> 36 <MinVersion Major="1" Valid="True"/> 37 </Item1> 38 <Item2> 35 39 <PackageName Value="LCL"/> 36 </Item 1>40 </Item2> 37 41 </RequiredPackages> 38 <Units Count=" 19">42 <Units Count="21"> 39 43 <Unit0> 40 44 <Filename Value="DelphiToC.lpr"/> 41 45 <IsPartOfProject Value="True"/> 42 <EditorIndex Value="1 1"/>46 <EditorIndex Value="14"/> 43 47 <WindowIndex Value="0"/> 44 48 <TopLine Value="4"/> 45 <CursorPos X=" 1" Y="27"/>46 <UsageCount Value="10 3"/>49 <CursorPos X="42" Y="15"/> 50 <UsageCount Value="104"/> 47 51 <Loaded Value="True"/> 48 52 </Unit0> … … 56 60 <EditorIndex Value="7"/> 57 61 <WindowIndex Value="0"/> 58 <TopLine Value=" 34"/>59 <CursorPos X=" 40" Y="49"/>60 <UsageCount Value="10 3"/>62 <TopLine Value="56"/> 63 <CursorPos X="1" Y="79"/> 64 <UsageCount Value="104"/> 61 65 <Loaded Value="True"/> 62 66 <LoadedDesigner Value="True"/> … … 69 73 <TopLine Value="1"/> 70 74 <CursorPos X="1" Y="1"/> 71 <UsageCount Value="10 3"/>75 <UsageCount Value="104"/> 72 76 </Unit2> 73 77 <Unit3> … … 77 81 <EditorIndex Value="5"/> 78 82 <WindowIndex Value="0"/> 79 <TopLine Value=" 268"/>80 <CursorPos X=" 14" Y="251"/>81 <UsageCount Value="10 3"/>83 <TopLine Value="119"/> 84 <CursorPos X="3" Y="132"/> 85 <UsageCount Value="104"/> 82 86 <Loaded Value="True"/> 83 87 </Unit3> … … 86 90 <IsPartOfProject Value="True"/> 87 91 <UnitName Value="UPascalCompiler"/> 88 <EditorIndex Value="1 0"/>92 <EditorIndex Value="13"/> 89 93 <WindowIndex Value="0"/> 90 94 <TopLine Value="36"/> 91 <CursorPos X="1 6" Y="40"/>92 <UsageCount Value="10 3"/>95 <CursorPos X="1" Y="41"/> 96 <UsageCount Value="104"/> 93 97 <Loaded Value="True"/> 94 98 </Unit4> … … 97 101 <IsPartOfProject Value="True"/> 98 102 <UnitName Value="UAssemblerSource"/> 99 <EditorIndex Value=" 8"/>100 <WindowIndex Value="0"/> 101 <TopLine Value="1 "/>102 <CursorPos X=" 9" Y="12"/>103 <UsageCount Value="10 3"/>103 <EditorIndex Value="9"/> 104 <WindowIndex Value="0"/> 105 <TopLine Value="112"/> 106 <CursorPos X="48" Y="128"/> 107 <UsageCount Value="104"/> 104 108 <Loaded Value="True"/> 105 109 </Unit5> … … 111 115 <WindowIndex Value="0"/> 112 116 <TopLine Value="1"/> 113 <CursorPos X="1 " Y="1"/>114 <UsageCount Value="10 3"/>117 <CursorPos X="15" Y="13"/> 118 <UsageCount Value="104"/> 115 119 <Loaded Value="True"/> 116 120 </Unit6> 117 121 <Unit7> 118 <Filename Value="Produce\U CSource.pas"/>119 <IsPartOfProject Value="True"/> 120 <UnitName Value="U CSource"/>121 <EditorIndex Value=" 9"/>122 <WindowIndex Value="0"/> 123 <TopLine Value=" 75"/>124 <CursorPos X=" 63" Y="89"/>125 <UsageCount Value="10 3"/>122 <Filename Value="Produce\UProducerC.pas"/> 123 <IsPartOfProject Value="True"/> 124 <UnitName Value="UProducerC"/> 125 <EditorIndex Value="10"/> 126 <WindowIndex Value="0"/> 127 <TopLine Value="130"/> 128 <CursorPos X="48" Y="144"/> 129 <UsageCount Value="104"/> 126 130 <Loaded Value="True"/> 127 131 </Unit7> … … 130 134 <IsPartOfProject Value="True"/> 131 135 <UnitName Value="UPascalParser"/> 132 <IsVisibleTab Value="True"/>133 136 <EditorIndex Value="0"/> 134 137 <WindowIndex Value="0"/> 135 <TopLine Value=" 528"/>136 <CursorPos X=" 1" Y="541"/>137 <UsageCount Value="10 3"/>138 <TopLine Value="137"/> 139 <CursorPos X="26" Y="555"/> 140 <UsageCount Value="104"/> 138 141 <Loaded Value="True"/> 139 142 </Unit8> … … 153 156 <TopLine Value="68"/> 154 157 <CursorPos X="14" Y="90"/> 155 <UsageCount Value="5 2"/>158 <UsageCount Value="53"/> 156 159 <Loaded Value="True"/> 157 160 </Unit10> … … 170 173 <TopLine Value="61"/> 171 174 <CursorPos X="7" Y="68"/> 172 <UsageCount Value="3 5"/>175 <UsageCount Value="36"/> 173 176 <Loaded Value="True"/> 174 177 </Unit12> … … 179 182 <TopLine Value="139"/> 180 183 <CursorPos X="16" Y="146"/> 181 <UsageCount Value="3 5"/>184 <UsageCount Value="36"/> 182 185 <Loaded Value="True"/> 183 186 </Unit13> … … 198 201 <Unit16> 199 202 <Filename Value="E:\Programy\Lazarus\fpc\2.4.0\source\rtl\inc\objpash.inc"/> 203 <EditorIndex Value="12"/> 200 204 <WindowIndex Value="0"/> 201 205 <TopLine Value="153"/> 202 206 <CursorPos X="8" Y="166"/> 203 <UsageCount Value="8"/> 207 <UsageCount Value="10"/> 208 <Loaded Value="True"/> 204 209 </Unit16> 205 210 <Unit17> … … 211 216 <TopLine Value="189"/> 212 217 <CursorPos X="1" Y="202"/> 213 <UsageCount Value="6 5"/>218 <UsageCount Value="66"/> 214 219 <Loaded Value="True"/> 215 220 </Unit17> … … 222 227 <UsageCount Value="5"/> 223 228 </Unit18> 229 <Unit19> 230 <Filename Value="E:\Programy\Lazarus\fpc\2.4.0\source\rtl\objpas\classes\classesh.inc"/> 231 <EditorIndex Value="11"/> 232 <WindowIndex Value="0"/> 233 <TopLine Value="263"/> 234 <CursorPos X="14" Y="276"/> 235 <UsageCount Value="10"/> 236 <Loaded Value="True"/> 237 </Unit19> 238 <Unit20> 239 <Filename Value="Produce\UProducerPascal.pas"/> 240 <IsPartOfProject Value="True"/> 241 <UnitName Value="UProducerPascal"/> 242 <IsVisibleTab Value="True"/> 243 <EditorIndex Value="8"/> 244 <WindowIndex Value="0"/> 245 <TopLine Value="173"/> 246 <CursorPos X="33" Y="192"/> 247 <UsageCount Value="21"/> 248 <Loaded Value="True"/> 249 </Unit20> 224 250 </Units> 225 <JumpHistory Count=" 30" HistoryIndex="29">251 <JumpHistory Count="27" HistoryIndex="26"> 226 252 <Position1> 227 <Filename Value=" Analyze\UPascalParser.pas"/>228 <Caret Line=" 554" Column="1" TopLine="539"/>253 <Filename Value="UPascalSource.pas"/> 254 <Caret Line="241" Column="27" TopLine="236"/> 229 255 </Position1> 230 256 <Position2> 231 <Filename Value=" Analyze\UPascalParser.pas"/>232 <Caret Line=" 556" Column="1" TopLine="539"/>257 <Filename Value="DelphiToC.lpr"/> 258 <Caret Line="27" Column="1" TopLine="4"/> 233 259 </Position2> 234 260 <Position3> 235 <Filename Value=" Analyze\UPascalParser.pas"/>236 <Caret Line=" 558" Column="1" TopLine="539"/>261 <Filename Value="UMainForm.pas"/> 262 <Caret Line="49" Column="40" TopLine="34"/> 237 263 </Position3> 238 264 <Position4> 239 <Filename Value=" Analyze\UPascalParser.pas"/>240 <Caret Line=" 559" Column="1" TopLine="539"/>265 <Filename Value="UMainForm.pas"/> 266 <Caret Line="48" Column="40" TopLine="33"/> 241 267 </Position4> 242 268 <Position5> 243 <Filename Value=" Analyze\UPascalParser.pas"/>244 <Caret Line="5 99" Column="1" TopLine="586"/>269 <Filename Value="UMainForm.pas"/> 270 <Caret Line="52" Column="40" TopLine="37"/> 245 271 </Position5> 246 272 <Position6> 247 <Filename Value=" Analyze\UPascalParser.pas"/>248 <Caret Line=" 600" Column="1" TopLine="586"/>273 <Filename Value="UMainForm.pas"/> 274 <Caret Line="51" Column="44" TopLine="38"/> 249 275 </Position6> 250 276 <Position7> 251 <Filename Value=" Analyze\UPascalParser.pas"/>252 <Caret Line=" 602" Column="1" TopLine="589"/>277 <Filename Value="UMainForm.pas"/> 278 <Caret Line="75" Column="11" TopLine="62"/> 253 279 </Position7> 254 280 <Position8> 255 <Filename Value=" Analyze\UPascalParser.pas"/>256 <Caret Line=" 603" Column="1" TopLine="589"/>281 <Filename Value="UMainForm.pas"/> 282 <Caret Line="91" Column="26" TopLine="73"/> 257 283 </Position8> 258 284 <Position9> 259 <Filename Value=" Analyze\UPascalParser.pas"/>260 <Caret Line=" 604" Column="1" TopLine="589"/>285 <Filename Value="UMainForm.pas"/> 286 <Caret Line="89" Column="21" TopLine="74"/> 261 287 </Position9> 262 288 <Position10> 263 <Filename Value=" Analyze\UPascalParser.pas"/>264 <Caret Line=" 605" Column="1" TopLine="595"/>289 <Filename Value="UMainForm.pas"/> 290 <Caret Line="91" Column="21" TopLine="76"/> 265 291 </Position10> 266 292 <Position11> 267 <Filename Value=" Analyze\UPascalParser.pas"/>268 <Caret Line=" 606" Column="1" TopLine="595"/>293 <Filename Value="Produce\UProducerPascal.pas"/> 294 <Caret Line="15" Column="10" TopLine="5"/> 269 295 </Position11> 270 296 <Position12> 271 <Filename Value=" Analyze\UPascalParser.pas"/>272 <Caret Line=" 607" Column="1" TopLine="595"/>297 <Filename Value="Produce\UProducerPascal.pas"/> 298 <Caret Line="27" Column="62" TopLine="13"/> 273 299 </Position12> 274 300 <Position13> 275 <Filename Value=" Analyze\UPascalParser.pas"/>276 <Caret Line="6 08" Column="1" TopLine="595"/>301 <Filename Value="Produce\UProducerPascal.pas"/> 302 <Caret Line="66" Column="1" TopLine="86"/> 277 303 </Position13> 278 304 <Position14> 279 <Filename Value=" Analyze\UPascalParser.pas"/>280 <Caret Line=" 610" Column="1" TopLine="595"/>305 <Filename Value="Produce\UProducerPascal.pas"/> 306 <Caret Line="59" Column="1" TopLine="50"/> 281 307 </Position14> 282 308 <Position15> 283 <Filename Value=" Analyze\UPascalParser.pas"/>284 <Caret Line=" 611" Column="1" TopLine="595"/>309 <Filename Value="Produce\UProducerPascal.pas"/> 310 <Caret Line="138" Column="1" TopLine="128"/> 285 311 </Position15> 286 312 <Position16> 287 <Filename Value=" Analyze\UPascalParser.pas"/>288 <Caret Line=" 612" Column="1" TopLine="595"/>313 <Filename Value="Produce\UProducerPascal.pas"/> 314 <Caret Line="72" Column="16" TopLine="59"/> 289 315 </Position16> 290 316 <Position17> 291 <Filename Value=" Analyze\UPascalParser.pas"/>292 <Caret Line=" 613" Column="1" TopLine="595"/>317 <Filename Value="Produce\UProducerPascal.pas"/> 318 <Caret Line="134" Column="1" TopLine="119"/> 293 319 </Position17> 294 320 <Position18> 295 <Filename Value=" Analyze\UPascalParser.pas"/>296 <Caret Line=" 614" Column="1" TopLine="595"/>321 <Filename Value="Produce\UProducerPascal.pas"/> 322 <Caret Line="130" Column="14" TopLine="118"/> 297 323 </Position18> 298 324 <Position19> 299 <Filename Value=" Analyze\UPascalParser.pas"/>300 <Caret Line=" 615" Column="1" TopLine="595"/>325 <Filename Value="Produce\UProducerPascal.pas"/> 326 <Caret Line="17" Column="1" TopLine="4"/> 301 327 </Position19> 302 328 <Position20> 303 <Filename Value=" Analyze\UPascalParser.pas"/>304 <Caret Line=" 620" Column="1" TopLine="599"/>329 <Filename Value="Produce\UProducerPascal.pas"/> 330 <Caret Line="133" Column="38" TopLine="120"/> 305 331 </Position20> 306 332 <Position21> 307 <Filename Value=" Analyze\UPascalParser.pas"/>308 <Caret Line=" 621" Column="1" TopLine="600"/>333 <Filename Value="UMainForm.pas"/> 334 <Caret Line="11" Column="18" TopLine="1"/> 309 335 </Position21> 310 336 <Position22> 311 <Filename Value=" Analyze\UPascalParser.pas"/>312 <Caret Line="6 22" Column="43" TopLine="610"/>337 <Filename Value="UMainForm.pas"/> 338 <Caret Line="60" Column="3" TopLine="50"/> 313 339 </Position22> 314 340 <Position23> 315 <Filename Value="U PascalSource.pas"/>316 <Caret Line=" 417" Column="1" TopLine="404"/>341 <Filename Value="UMainForm.pas"/> 342 <Caret Line="55" Column="9" TopLine="50"/> 317 343 </Position23> 318 344 <Position24> 319 <Filename Value="U PascalSource.pas"/>320 <Caret Line=" 418" Column="1" TopLine="404"/>345 <Filename Value="UMainForm.pas"/> 346 <Caret Line="69" Column="8" TopLine="56"/> 321 347 </Position24> 322 348 <Position25> 323 <Filename Value="U PascalSource.pas"/>324 <Caret Line=" 419" Column="1" TopLine="404"/>349 <Filename Value="UMainForm.pas"/> 350 <Caret Line="81" Column="18" TopLine="61"/> 325 351 </Position25> 326 352 <Position26> 327 <Filename Value="UPascal Source.pas"/>328 <Caret Line="4 20" Column="1" TopLine="404"/>353 <Filename Value="UPascalCompiler.pas"/> 354 <Caret Line="41" Column="15" TopLine="36"/> 329 355 </Position26> 330 356 <Position27> 331 <Filename Value="U PascalSource.pas"/>332 <Caret Line=" 421" Column="1" TopLine="404"/>357 <Filename Value="UMainForm.pas"/> 358 <Caret Line="79" Column="1" TopLine="56"/> 333 359 </Position27> 334 <Position28>335 <Filename Value="UPascalSource.pas"/>336 <Caret Line="417" Column="1" TopLine="404"/>337 </Position28>338 <Position29>339 <Filename Value="UPascalSource.pas"/>340 <Caret Line="418" Column="1" TopLine="404"/>341 </Position29>342 <Position30>343 <Filename Value="UPascalSource.pas"/>344 <Caret Line="251" Column="14" TopLine="268"/>345 </Position30>346 360 </JumpHistory> 347 361 </ProjectOptions> -
branches/DelphiToC/DelphiToC.lpr
r41 r46 14 14 UAssemblerSource in 'Produce\UAssemblerSource.pas', 15 15 UCodeProducer in 'Produce\UCodeProducer.pas', 16 U CSource in 'Produce\UCSource.pas',16 UProducerC, UProducerPascal, 17 17 UPascalParser in 'Analyze\UPascalParser.pas', USourceTree; 18 18 -
branches/DelphiToC/Example.pas
r44 r46 4 4 5 5 procedure Pokus(A: Byte); 6 var 7 S: Byte; 6 8 begin 9 WriteLn; 10 WriteLn; 7 11 end; 8 12 … … 26 30 A := 1; 27 31 if A = 2 then begin 32 A := 3; 28 33 end; 29 34 while A < 1 do A := A + 1; -
branches/DelphiToC/UMainForm.lfm
r42 r46 1 1 object MainForm: TMainForm 2 Left = 1 503 Height = 5 354 Top = 625 Width = 8 832 Left = 169 3 Height = 515 4 Top = 110 5 Width = 872 6 6 Caption = 'Pascal Compiler AVR' 7 ClientHeight = 5 358 ClientWidth = 8 837 ClientHeight = 515 8 ClientWidth = 872 9 9 Font.Height = -11 10 10 Font.Name = 'Tahoma' … … 15 15 Position = poDesktopCenter 16 16 LCLVersion = '0.9.29' 17 object Memo1: TMemo18 Left = 819 Height = 42420 Top = 821 Width = 28122 Anchors = [akTop, akLeft, akBottom]23 Font.Height = -1324 Font.Name = 'Lucida Console'25 ParentFont = False26 ScrollBars = ssBoth27 TabOrder = 028 end29 17 object Button1: TButton 30 18 Left = 8 31 19 Height = 22 32 Top = 51020 Top = 490 33 21 Width = 75 34 22 Anchors = [akLeft, akBottom] 35 23 Caption = 'Kompilovat' 36 24 OnClick = Button1Click 37 TabOrder = 125 TabOrder = 0 38 26 end 39 27 object Memo2: TMemo 40 Left = 6 0041 Height = 42442 Top = 843 Width = 27728 Left = 672 29 Height = 380 30 Top = 32 31 Width = 194 44 32 Anchors = [akTop, akLeft, akRight, akBottom] 45 33 Font.Height = -13 … … 47 35 ParentFont = False 48 36 ScrollBars = ssBoth 49 TabOrder = 237 TabOrder = 1 50 38 end 51 39 object Memo3: TMemo 52 40 Left = 8 53 41 Height = 66 54 Top = 4 3855 Width = 8 6942 Top = 418 43 Width = 858 56 44 Anchors = [akLeft, akRight, akBottom] 57 45 ScrollBars = ssBoth 58 TabOrder = 346 TabOrder = 2 59 47 end 60 48 object TreeView1: TTreeView 61 Left = 29662 Height = 4 2449 Left = 368 50 Height = 404 63 51 Top = 8 64 Width = 29 852 Width = 296 65 53 Anchors = [akTop, akLeft, akBottom] 66 54 DefaultItemHeight = 15 67 55 Indent = 19 56 TabOrder = 3 57 end 58 inline SynEdit1: TSynEdit 59 Left = 8 60 Height = 405 61 Top = 8 62 Width = 352 63 Anchors = [akTop, akLeft, akBottom] 64 Font.Height = -13 65 Font.Name = 'Courier New' 66 Font.Pitch = fpFixed 67 Font.Quality = fqNonAntialiased 68 ParentColor = False 69 ParentFont = False 68 70 TabOrder = 4 71 Gutter.Width = 57 72 Gutter.MouseActions = < 73 item 74 Shift = [] 75 ShiftMask = [] 76 Button = mbLeft 77 ClickCount = ccAny 78 ClickDir = cdDown 79 Command = 13 80 MoveCaret = False 81 Option = 0 82 Priority = 0 83 end 84 item 85 Shift = [] 86 ShiftMask = [] 87 Button = mbRight 88 ClickCount = ccSingle 89 ClickDir = cdUp 90 Command = 12 91 MoveCaret = False 92 Option = 0 93 Priority = 0 94 end> 95 Highlighter = SynPasSyn1 96 Keystrokes = < 97 item 98 Command = ecUp 99 ShortCut = 38 100 end 101 item 102 Command = ecSelUp 103 ShortCut = 8230 104 end 105 item 106 Command = ecScrollUp 107 ShortCut = 16422 108 end 109 item 110 Command = ecDown 111 ShortCut = 40 112 end 113 item 114 Command = ecSelDown 115 ShortCut = 8232 116 end 117 item 118 Command = ecScrollDown 119 ShortCut = 16424 120 end 121 item 122 Command = ecLeft 123 ShortCut = 37 124 end 125 item 126 Command = ecSelLeft 127 ShortCut = 8229 128 end 129 item 130 Command = ecWordLeft 131 ShortCut = 16421 132 end 133 item 134 Command = ecSelWordLeft 135 ShortCut = 24613 136 end 137 item 138 Command = ecRight 139 ShortCut = 39 140 end 141 item 142 Command = ecSelRight 143 ShortCut = 8231 144 end 145 item 146 Command = ecWordRight 147 ShortCut = 16423 148 end 149 item 150 Command = ecSelWordRight 151 ShortCut = 24615 152 end 153 item 154 Command = ecPageDown 155 ShortCut = 34 156 end 157 item 158 Command = ecSelPageDown 159 ShortCut = 8226 160 end 161 item 162 Command = ecPageBottom 163 ShortCut = 16418 164 end 165 item 166 Command = ecSelPageBottom 167 ShortCut = 24610 168 end 169 item 170 Command = ecPageUp 171 ShortCut = 33 172 end 173 item 174 Command = ecSelPageUp 175 ShortCut = 8225 176 end 177 item 178 Command = ecPageTop 179 ShortCut = 16417 180 end 181 item 182 Command = ecSelPageTop 183 ShortCut = 24609 184 end 185 item 186 Command = ecLineStart 187 ShortCut = 36 188 end 189 item 190 Command = ecSelLineStart 191 ShortCut = 8228 192 end 193 item 194 Command = ecEditorTop 195 ShortCut = 16420 196 end 197 item 198 Command = ecSelEditorTop 199 ShortCut = 24612 200 end 201 item 202 Command = ecLineEnd 203 ShortCut = 35 204 end 205 item 206 Command = ecSelLineEnd 207 ShortCut = 8227 208 end 209 item 210 Command = ecEditorBottom 211 ShortCut = 16419 212 end 213 item 214 Command = ecSelEditorBottom 215 ShortCut = 24611 216 end 217 item 218 Command = ecToggleMode 219 ShortCut = 45 220 end 221 item 222 Command = ecCopy 223 ShortCut = 16429 224 end 225 item 226 Command = ecPaste 227 ShortCut = 8237 228 end 229 item 230 Command = ecDeleteChar 231 ShortCut = 46 232 end 233 item 234 Command = ecCut 235 ShortCut = 8238 236 end 237 item 238 Command = ecDeleteLastChar 239 ShortCut = 8 240 end 241 item 242 Command = ecDeleteLastChar 243 ShortCut = 8200 244 end 245 item 246 Command = ecDeleteLastWord 247 ShortCut = 16392 248 end 249 item 250 Command = ecUndo 251 ShortCut = 32776 252 end 253 item 254 Command = ecRedo 255 ShortCut = 40968 256 end 257 item 258 Command = ecLineBreak 259 ShortCut = 13 260 end 261 item 262 Command = ecSelectAll 263 ShortCut = 16449 264 end 265 item 266 Command = ecCopy 267 ShortCut = 16451 268 end 269 item 270 Command = ecBlockIndent 271 ShortCut = 24649 272 end 273 item 274 Command = ecLineBreak 275 ShortCut = 16461 276 end 277 item 278 Command = ecInsertLine 279 ShortCut = 16462 280 end 281 item 282 Command = ecDeleteWord 283 ShortCut = 16468 284 end 285 item 286 Command = ecBlockUnindent 287 ShortCut = 24661 288 end 289 item 290 Command = ecPaste 291 ShortCut = 16470 292 end 293 item 294 Command = ecCut 295 ShortCut = 16472 296 end 297 item 298 Command = ecDeleteLine 299 ShortCut = 16473 300 end 301 item 302 Command = ecDeleteEOL 303 ShortCut = 24665 304 end 305 item 306 Command = ecUndo 307 ShortCut = 16474 308 end 309 item 310 Command = ecRedo 311 ShortCut = 24666 312 end 313 item 314 Command = ecGotoMarker0 315 ShortCut = 16432 316 end 317 item 318 Command = ecGotoMarker1 319 ShortCut = 16433 320 end 321 item 322 Command = ecGotoMarker2 323 ShortCut = 16434 324 end 325 item 326 Command = ecGotoMarker3 327 ShortCut = 16435 328 end 329 item 330 Command = ecGotoMarker4 331 ShortCut = 16436 332 end 333 item 334 Command = ecGotoMarker5 335 ShortCut = 16437 336 end 337 item 338 Command = ecGotoMarker6 339 ShortCut = 16438 340 end 341 item 342 Command = ecGotoMarker7 343 ShortCut = 16439 344 end 345 item 346 Command = ecGotoMarker8 347 ShortCut = 16440 348 end 349 item 350 Command = ecGotoMarker9 351 ShortCut = 16441 352 end 353 item 354 Command = ecSetMarker0 355 ShortCut = 24624 356 end 357 item 358 Command = ecSetMarker1 359 ShortCut = 24625 360 end 361 item 362 Command = ecSetMarker2 363 ShortCut = 24626 364 end 365 item 366 Command = ecSetMarker3 367 ShortCut = 24627 368 end 369 item 370 Command = ecSetMarker4 371 ShortCut = 24628 372 end 373 item 374 Command = ecSetMarker5 375 ShortCut = 24629 376 end 377 item 378 Command = ecSetMarker6 379 ShortCut = 24630 380 end 381 item 382 Command = ecSetMarker7 383 ShortCut = 24631 384 end 385 item 386 Command = ecSetMarker8 387 ShortCut = 24632 388 end 389 item 390 Command = ecSetMarker9 391 ShortCut = 24633 392 end 393 item 394 Command = EcFoldLevel1 395 ShortCut = 41009 396 end 397 item 398 Command = EcFoldLevel2 399 ShortCut = 41010 400 end 401 item 402 Command = EcFoldLevel1 403 ShortCut = 41011 404 end 405 item 406 Command = EcFoldLevel1 407 ShortCut = 41012 408 end 409 item 410 Command = EcFoldLevel1 411 ShortCut = 41013 412 end 413 item 414 Command = EcFoldLevel6 415 ShortCut = 41014 416 end 417 item 418 Command = EcFoldLevel7 419 ShortCut = 41015 420 end 421 item 422 Command = EcFoldLevel8 423 ShortCut = 41016 424 end 425 item 426 Command = EcFoldLevel9 427 ShortCut = 41017 428 end 429 item 430 Command = EcFoldLevel0 431 ShortCut = 41008 432 end 433 item 434 Command = EcFoldCurrent 435 ShortCut = 41005 436 end 437 item 438 Command = EcUnFoldCurrent 439 ShortCut = 41003 440 end 441 item 442 Command = EcToggleMarkupWord 443 ShortCut = 32845 444 end 445 item 446 Command = ecNormalSelect 447 ShortCut = 24654 448 end 449 item 450 Command = ecColumnSelect 451 ShortCut = 24643 452 end 453 item 454 Command = ecLineSelect 455 ShortCut = 24652 456 end 457 item 458 Command = ecTab 459 ShortCut = 9 460 end 461 item 462 Command = ecShiftTab 463 ShortCut = 8201 464 end 465 item 466 Command = ecMatchBracket 467 ShortCut = 24642 468 end 469 item 470 Command = ecColSelUp 471 ShortCut = 40998 472 end 473 item 474 Command = ecColSelDown 475 ShortCut = 41000 476 end 477 item 478 Command = ecColSelLeft 479 ShortCut = 40997 480 end 481 item 482 Command = ecColSelRight 483 ShortCut = 40999 484 end 485 item 486 Command = ecColSelPageDown 487 ShortCut = 40994 488 end 489 item 490 Command = ecColSelPageBottom 491 ShortCut = 57378 492 end 493 item 494 Command = ecColSelPageUp 495 ShortCut = 40993 496 end 497 item 498 Command = ecColSelPageTop 499 ShortCut = 57377 500 end 501 item 502 Command = ecColSelLineStart 503 ShortCut = 40996 504 end 505 item 506 Command = ecColSelLineEnd 507 ShortCut = 40995 508 end 509 item 510 Command = ecColSelEditorTop 511 ShortCut = 57380 512 end 513 item 514 Command = ecColSelEditorBottom 515 ShortCut = 57379 516 end> 517 MouseActions = < 518 item 519 Shift = [] 520 ShiftMask = [ssShift, ssAlt] 521 Button = mbLeft 522 ClickCount = ccSingle 523 ClickDir = cdDown 524 Command = 1 525 MoveCaret = True 526 Option = 0 527 Priority = 0 528 end 529 item 530 Shift = [ssShift] 531 ShiftMask = [ssShift, ssAlt] 532 Button = mbLeft 533 ClickCount = ccSingle 534 ClickDir = cdDown 535 Command = 1 536 MoveCaret = True 537 Option = 1 538 Priority = 0 539 end 540 item 541 Shift = [ssAlt] 542 ShiftMask = [ssShift, ssAlt] 543 Button = mbLeft 544 ClickCount = ccSingle 545 ClickDir = cdDown 546 Command = 3 547 MoveCaret = True 548 Option = 0 549 Priority = 0 550 end 551 item 552 Shift = [ssShift, ssAlt] 553 ShiftMask = [ssShift, ssAlt] 554 Button = mbLeft 555 ClickCount = ccSingle 556 ClickDir = cdDown 557 Command = 3 558 MoveCaret = True 559 Option = 1 560 Priority = 0 561 end 562 item 563 Shift = [] 564 ShiftMask = [] 565 Button = mbRight 566 ClickCount = ccSingle 567 ClickDir = cdUp 568 Command = 12 569 MoveCaret = False 570 Option = 0 571 Priority = 0 572 end 573 item 574 Shift = [] 575 ShiftMask = [] 576 Button = mbLeft 577 ClickCount = ccDouble 578 ClickDir = cdDown 579 Command = 6 580 MoveCaret = True 581 Option = 0 582 Priority = 0 583 end 584 item 585 Shift = [] 586 ShiftMask = [] 587 Button = mbLeft 588 ClickCount = ccTriple 589 ClickDir = cdDown 590 Command = 7 591 MoveCaret = True 592 Option = 0 593 Priority = 0 594 end 595 item 596 Shift = [] 597 ShiftMask = [] 598 Button = mbLeft 599 ClickCount = ccQuad 600 ClickDir = cdDown 601 Command = 8 602 MoveCaret = True 603 Option = 0 604 Priority = 0 605 end 606 item 607 Shift = [] 608 ShiftMask = [] 609 Button = mbMiddle 610 ClickCount = ccSingle 611 ClickDir = cdDown 612 Command = 10 613 MoveCaret = True 614 Option = 0 615 Priority = 0 616 end 617 item 618 Shift = [ssCtrl] 619 ShiftMask = [ssShift, ssAlt, ssCtrl] 620 Button = mbLeft 621 ClickCount = ccSingle 622 ClickDir = cdUp 623 Command = 11 624 MoveCaret = False 625 Option = 0 626 Priority = 0 627 end> 628 MouseSelActions = < 629 item 630 Shift = [] 631 ShiftMask = [] 632 Button = mbLeft 633 ClickCount = ccSingle 634 ClickDir = cdDown 635 Command = 9 636 MoveCaret = False 637 Option = 0 638 Priority = 0 639 end> 640 Lines.Strings = ( 641 'SynEdit1' 642 ) 643 BracketHighlightStyle = sbhsBoth 644 inline SynGutterPartList1: TSynGutterPartList 645 object SynGutterMarks1: TSynGutterMarks 646 Width = 23 647 end 648 object SynGutterLineNumber1: TSynGutterLineNumber 649 Width = 17 650 MouseActions = <> 651 MarkupInfo.Background = clBtnFace 652 MarkupInfo.Foreground = clNone 653 DigitCount = 2 654 ShowOnlyLineNumbersMultiplesOf = 1 655 ZeroStart = False 656 LeadingZeros = False 657 end 658 object SynGutterChanges1: TSynGutterChanges 659 Width = 4 660 ModifiedColor = 59900 661 SavedColor = clGreen 662 end 663 object SynGutterSeparator1: TSynGutterSeparator 664 Width = 2 665 end 666 object SynGutterCodeFolding1: TSynGutterCodeFolding 667 MouseActions = < 668 item 669 Shift = [] 670 ShiftMask = [] 671 Button = mbRight 672 ClickCount = ccSingle 673 ClickDir = cdUp 674 Command = 16 675 MoveCaret = False 676 Option = 0 677 Priority = 0 678 end 679 item 680 Shift = [] 681 ShiftMask = [ssShift] 682 Button = mbMiddle 683 ClickCount = ccAny 684 ClickDir = cdDown 685 Command = 14 686 MoveCaret = False 687 Option = 0 688 Priority = 0 689 end 690 item 691 Shift = [ssShift] 692 ShiftMask = [ssShift] 693 Button = mbMiddle 694 ClickCount = ccAny 695 ClickDir = cdDown 696 Command = 14 697 MoveCaret = False 698 Option = 1 699 Priority = 0 700 end 701 item 702 Shift = [] 703 ShiftMask = [] 704 Button = mbLeft 705 ClickCount = ccAny 706 ClickDir = cdDown 707 Command = 0 708 MoveCaret = False 709 Option = 0 710 Priority = 0 711 end> 712 MarkupInfo.Background = clNone 713 MarkupInfo.Foreground = clGray 714 MouseActionsExpanded = < 715 item 716 Shift = [] 717 ShiftMask = [] 718 Button = mbLeft 719 ClickCount = ccAny 720 ClickDir = cdDown 721 Command = 14 722 MoveCaret = False 723 Option = 0 724 Priority = 0 725 end> 726 MouseActionsCollapsed = < 727 item 728 Shift = [ssCtrl] 729 ShiftMask = [ssCtrl] 730 Button = mbLeft 731 ClickCount = ccAny 732 ClickDir = cdDown 733 Command = 15 734 MoveCaret = False 735 Option = 0 736 Priority = 0 737 end 738 item 739 Shift = [] 740 ShiftMask = [ssCtrl] 741 Button = mbLeft 742 ClickCount = ccAny 743 ClickDir = cdDown 744 Command = 15 745 MoveCaret = False 746 Option = 1 747 Priority = 0 748 end> 749 end 750 end 751 end 752 object ComboBox1: TComboBox 753 Left = 672 754 Height = 21 755 Top = 8 756 Width = 196 757 Anchors = [akTop, akLeft, akRight] 758 ItemHeight = 13 759 ItemIndex = 0 760 Items.Strings = ( 761 'Pascal' 762 'C' 763 'i8051' 764 ) 765 OnChange = ComboBox1Change 766 Style = csDropDownList 767 TabOrder = 5 768 Text = 'Pascal' 769 end 770 object SynPasSyn1: TSynPasSyn 771 CompilerMode = pcmDelphi 772 NestedComments = False 773 left = 183 774 top = 48 69 775 end 70 776 end -
branches/DelphiToC/UMainForm.pas
r42 r46 8 8 SysUtils, Variants, Classes, Graphics, Controls, Forms, 9 9 Dialogs, StdCtrls, UPascalSource, UPascalCompiler, UAssemblerSource, 10 UCSource, ComCtrls, USourceTree; 10 UProducerC, ComCtrls, SynEdit, SynHighlighterPas, USourceTree, 11 UProducerPascal; 11 12 12 13 const … … 14 15 15 16 type 17 18 { TMainForm } 19 16 20 TMainForm = class(TForm) 17 Memo1: TMemo;18 21 Button1: TButton; 22 ComboBox1: TComboBox; 19 23 Memo2: TMemo; 20 24 Memo3: TMemo; 25 SynEdit1: TSynEdit; 26 SynPasSyn1: TSynPasSyn; 21 27 TreeView1: TTreeView; 28 procedure ComboBox1Change(Sender: TObject); 22 29 procedure FormShow(Sender: TObject); 23 30 procedure FormClose(Sender: TObject; var Action: TCloseAction); … … 46 53 begin 47 54 MainForm.Memo3.Clear; 48 Compiler.SourceCode.Assign(Memo1.Lines); 49 Compiler.Compile; 55 Compiler.SourceCode.Assign(SynEdit1.Lines); 56 57 Memo2.Clear; 58 if ComboBox1.ItemIndex = 0 then begin 59 Compiler.Producer.Free; 60 Compiler.Producer := TProducerPascal.Create; 61 Compiler.Producer.ProgramCode := Compiler.ProgramCode; 62 Compiler.Compile; 63 with TProducerPascal(Compiler.Producer) do 64 Memo2.Lines.Assign(TextSource); 65 end else 66 if ComboBox1.ItemIndex = 1 then begin 67 Compiler.Producer.Free; 68 Compiler.Producer := TCProducer.Create; 69 Compiler.Producer.ProgramCode := Compiler.ProgramCode; 70 Compiler.Compile; 71 with TCProducer(Compiler.Producer) do 72 Memo2.Lines.Assign(TextSource); 73 end else 74 if ComboBox1.ItemIndex = 2 then begin 75 Compiler.Producer.Free; 76 Compiler.Producer := TAssemblerProducer.Create; 77 Compiler.Producer.ProgramCode := Compiler.ProgramCode; 78 Compiler.Compile; 79 with TAssemblerProducer(Compiler.Producer) do 80 for I := 0 to AssemblyCode.Count - 1 do 81 Memo2.Lines.Add(TAssemblerLine(AssemblyCode[I]).AsString); 82 end; 83 50 84 SourceTree.TreeView := TreeView1; 51 85 SourceTree.Code := Compiler.ProgramCode; 52 86 SourceTree.Fill; 53 Memo2.Clear;54 if Compiler.Producer is TAssemblerProducer then begin55 with TAssemblerProducer(Compiler.Producer) do56 for I := 0 to AssemblyCode.Count - 1 do57 Memo2.Lines.Add(TAssemblerLine(AssemblyCode[I]).AsString);58 end else59 if Compiler.Producer is TCProducer then begin60 with TCProducer(Compiler.Producer) do61 Memo2.Lines.Assign(TextSource);62 end;63 87 end; 64 88 … … 70 94 procedure TMainForm.FormClose(Sender: TObject; var Action: TCloseAction); 71 95 begin 72 Memo1.Lines.SaveToFile(ExampleFileName);96 SynEdit1.Lines.SaveToFile(ExampleFileName); 73 97 end; 74 98 … … 89 113 begin 90 114 WindowState := wsMaximized; 91 Memo1.Lines.LoadFromFile(ExampleFileName); 115 SynEdit1.Lines.LoadFromFile(ExampleFileName); 116 Button1Click(Self); 117 end; 118 119 procedure TMainForm.ComboBox1Change(Sender: TObject); 120 begin 92 121 Button1Click(Self); 93 122 end; -
branches/DelphiToC/UPascalCompiler.pas
r45 r46 8 8 SysUtils, Variants, Classes, Graphics, Controls, Forms, 9 9 Dialogs, UPascalSource, UCodeProducer, UPascalParser, 10 U CSource;10 UProducerC; 11 11 12 12 type
Note:
See TracChangeset
for help on using the changeset viewer.