Changeset 33 for trunk


Ignore:
Timestamp:
Feb 18, 2012, 11:08:44 PM (12 years ago)
Author:
chronos
Message:
  • Modified: CompiledForm replaced by compiled source tab in PageControl on MainForm.
  • Added: Function for switching position between source code and target code.
Location:
trunk
Files:
4 added
3 deleted
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UInterpretterForm.lfm

    r30 r33  
    229229    end
    230230    object ToolButton4: TToolButton
    231       Left = 70
     231      Left = 139
    232232      Top = 2
    233233      Action = MainForm.AProgramRunToCursor
     
    244244    end
    245245    object ToolButton7: TToolButton
    246       Left = 139
    247       Top = 2
    248       Action = MainForm.AProgramStopOver
     246      Left = 70
     247      Top = 2
     248      Action = MainForm.AProgramStepOver
    249249    end
    250250  end
  • trunk/Forms/UMainForm.lfm

    r32 r33  
    1414  LCLVersion = '0.9.31'
    1515  WindowState = wsMaximized
    16   object MemoSource: TMemo
    17     Left = 0
    18     Height = 363
    19     Top = 56
    20     Width = 643
    21     Align = alClient
    22     Font.Height = -12
    23     Font.Name = 'Courier New'
    24     OnChange = MemoSourceChange
    25     OnKeyDown = MemoSourceKeyDown
    26     OnKeyPress = MemoSourceKeyPress
    27     OnKeyUp = MemoSourceKeyUp
    28     OnMouseDown = MemoSourceMouseDown
    29     ParentFont = False
    30     PopupMenu = PopupMenuSource
    31     ScrollBars = ssAutoBoth
    32     TabOrder = 0
    33   end
    3416  object StatusBar1: TStatusBar
    3517    Left = 0
     
    5739    ParentShowHint = False
    5840    ShowHint = True
    59     TabOrder = 2
     41    TabOrder = 1
    6042    object ToolButton1: TToolButton
    6143      Left = 1
     
    11799      Left = 241
    118100      Top = 2
    119       Caption = 'ToolButton12'
     101      Action = AProgramStepOver
    120102    end
    121103    object ToolButton13: TToolButton
    122104      Left = 264
    123105      Top = 2
    124       Caption = 'ToolButton13'
     106      Action = AProgramStepInto
    125107    end
    126108    object ToolButton14: TToolButton
    127109      Left = 287
    128110      Top = 2
    129       Caption = 'ToolButton14'
     111      Action = AProgramStepOut
    130112    end
    131113    object ToolButton15: TToolButton
    132114      Left = 310
    133115      Top = 2
    134       Caption = 'ToolButton15'
     116      Action = AProgramRunToCursor
    135117    end
    136118  end
    137   object TabControl1: TTabControl
     119  object PageControl1: TPageControl
    138120    Left = 0
    139     Height = 30
     121    Height = 393
    140122    Top = 26
    141123    Width = 643
    142     Align = alTop
    143     TabOrder = 3
    144     Visible = False
     124    ActivePage = TabSheetTarget
     125    Align = alClient
     126    ParentFont = False
     127    TabIndex = 1
     128    TabOrder = 2
     129    object TabSheetSource: TTabSheet
     130      Caption = 'Source code'
     131      ClientHeight = 366
     132      ClientWidth = 641
     133      object MemoSource: TMemo
     134        Left = 0
     135        Height = 366
     136        Top = 0
     137        Width = 641
     138        Align = alClient
     139        Font.Height = -12
     140        Font.Name = 'Courier New'
     141        OnChange = MemoSourceChange
     142        OnKeyDown = MemoSourceKeyDown
     143        OnKeyPress = MemoSourceKeyPress
     144        OnKeyUp = MemoSourceKeyUp
     145        OnMouseDown = MemoSourceMouseDown
     146        ParentFont = False
     147        PopupMenu = PopupMenuSource
     148        ScrollBars = ssAutoBoth
     149        TabOrder = 0
     150      end
     151    end
     152    object TabSheetTarget: TTabSheet
     153      Caption = 'Target code'
     154      ClientHeight = 366
     155      ClientWidth = 641
     156      object MemoTarget: TMemo
     157        Left = 0
     158        Height = 366
     159        Top = 0
     160        Width = 641
     161        Align = alClient
     162        PopupMenu = PopupMenuTarget
     163        ReadOnly = True
     164        ScrollBars = ssAutoBoth
     165        TabOrder = 0
     166      end
     167    end
    145168  end
    146169  object MainMenu1: TMainMenu
     
    666689        Action = AViewInterpretter
    667690      end
    668       object MenuItem20: TMenuItem
    669         Action = AViewCompiled
    670       end
    671691    end
    672692    object MenuItem10: TMenuItem
     
    804824      OnExecute = AViewInterpretterExecute
    805825    end
    806     object AViewCompiled: TAction
    807       Category = 'View'
    808       Caption = 'Compiled'
    809       OnExecute = AViewCompiledExecute
    810     end
    811826    object AProgramStepInto: TAction
    812827      Category = 'Program'
    813828      Caption = 'Step into'
     829      ImageIndex = 15
    814830      ShortCut = 118
    815831    end
     
    817833      Category = 'Program'
    818834      Caption = 'Step over'
     835      ImageIndex = 17
    819836      ShortCut = 119
    820837    end
     
    822839      Category = 'Program'
    823840      Caption = 'Run to cursor'
     841      ImageIndex = 14
    824842      ShortCut = 115
    825843    end
     
    827845      Category = 'Program'
    828846      Caption = 'Step out'
     847      ImageIndex = 16
    829848      ShortCut = 8311
    830849    end
     
    861880      OnExecute = AViewCompilersExecute
    862881    end
     882    object AShowTargetPosition: TAction
     883      Caption = 'Show position in target'
     884      OnExecute = AShowTargetPositionExecute
     885    end
     886    object AShowSourcePosition: TAction
     887      Caption = 'Show position in source'
     888      OnExecute = AShowSourcePositionExecute
     889    end
    863890  end
    864891  object ImageList1: TImageList
     
    866893    top = 96
    867894    Bitmap = {
    868       4C690E0000001000000010000000000000000000000000000000000000000000
     895      4C69120000001000000010000000000000000000000000000000000000000000
    869896      0000000000000000000000000000000000000000000000000000000000000000
    870897      000000000000000000000000000000000000000000FF000000FF000000FF0000
     
    13141341      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
    13151342      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1343      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1344      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1345      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1346      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00D7D7D74CCCCCCCA0CCCCCCA0CCCC
     1347      CCA0CCCCCCA0CCCCCCA0D7D7D74CFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1348      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00CCCCCCA0000000FF000000FF0000
     1349      00FF000000FF000000FFCCCCCCA0FFFFFF000000000800000006FFFFFF00FFFF
     1350      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00D7D7D74CCCCCCCA0BEBEBED50000
     1351      00FFBEBEBED5CCCCCCA0D7D7D74CFFFFFF0000000028004000DB002E00790000
     1352      0006FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00CCCCCCA00000
     1353      00FFCCCCCCA0FFFFFF00FFFFFF00FFFFFF0000000028006C00FF007C00FF0051
     1354      00D30031007800000006FFFFFF00FFFFFF00FFFFFF00FFFFFF00CCCCCCA00000
     1355      00FFCCCCCCA0FFFFFF00FFFFFF00FFFFFF0000000028006C00FF008000FF0080
     1356      00FF007D00FF005200D30031007700000006FFFFFF00FFFFFF00CCCCCCA00000
     1357      00FFCCCCCCA0FFFFFF00FFFFFF00FFFFFF0000000028006C00FF008000FF0080
     1358      00FF008000FF008000FF007D00FF005300D20031007700000006CCCCCCA00000
     1359      00FFCCCCCCA0FFFFFF00FFFFFF00FFFFFF0000000028006C00FF008000FF0080
     1360      00FF008000FF008000FF007D00FF005300D20031007700000006CCCCCCA00000
     1361      00FFCCCCCCA0FFFFFF00FFFFFF00FFFFFF0000000028006C00FF008000FF0080
     1362      00FF007D00FF005200D30031007700000006FFFFFF00FFFFFF00CCCCCCA00000
     1363      00FFCCCCCCA0FFFFFF00FFFFFF00FFFFFF0000000028006C00FF007C00FF0051
     1364      00D30031007800000006FFFFFF00FFFFFF00FFFFFF00FFFFFF00CCCCCCA00000
     1365      00FFCCCCCCA0FFFFFF00FFFFFF00FFFFFF0000000028004000DB002E00790000
     1366      0006FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00CCCCCCA00000
     1367      00FFCCCCCCA0FFFFFF00FFFFFF00FFFFFF000000000800000006FFFFFF00FFFF
     1368      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00D7D7D74CCCCCCCA0BEBEBED50000
     1369      00FFBEBEBED5CCCCCCA0D7D7D74CFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1370      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00CCCCCCA0000000FF000000FF0000
     1371      00FF000000FF000000FFCCCCCCA0FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1372      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00D7D7D74CCCCCCCA0CCCCCCA0CCCC
     1373      CCA0CCCCCCA0CCCCCCA0D7D7D74CFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1374      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1375      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1376      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1377      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1378      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1379      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000AB4C0000AAD10000
     1380      AAFF0000AAFF0000AAFF0000AAFF0000AAC0FFFFFF00FFFFFF00FFFFFF00FFFF
     1381      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000AAD10000A838FFFF
     1382      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1383      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000AAFFFFFFFF00FFFF
     1384      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1385      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000AAFFFFFFFF00FFFF
     1386      FF00FFFFFF00000000FF000000FF000000FF000000FF000000FF000000FF0000
     1387      00FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFFFF000000AAFFFFFFFF00FFFF
     1388      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1389      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000AAFFFFFFFF00FFFF
     1390      FF00FFFFFF00FFFFFF00FFFFFF00000000FF000000FF000000FF000000FF0000
     1391      00FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFFFF000000AAFFFFFFFF00FFFF
     1392      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1393      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000AAD10000A8380000
     1394      ABA60000AB5B0000AA06FFFFFF00000000FF000000FF000000FF000000FF0000
     1395      00FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFFFF000000AB4C0000AAD10000
     1396      AAFF0000AAFF0000AADB0000AA1BFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1397      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000
     1398      ABA60000AB5B0000AA06FFFFFF00000000FF000000FF000000FF000000FF0000
     1399      00FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1400      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1401      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1402      FF00FFFFFF00000000FF000000FF000000FF000000FF000000FF000000FF0000
     1403      00FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1404      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1405      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1406      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1407      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1408      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1409      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1410      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1411      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1412      FF00FFFFFF00000000FF000000FF000000FF000000FF000000FF000000FF0000
     1413      00FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1414      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1415      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1416      FF00FFFFFF00FFFFFF00FFFFFF00000000FF000000FF000000FF000000FF0000
     1417      00FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFFFF000000AB4C0000AAD10000
     1418      AAFF0000AAFF0000AAC0FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1419      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000AAD10000A838FFFF
     1420      FF00FFFFFF00FFFFFF00FFFFFF00000000FF000000FF000000FF000000FF0000
     1421      00FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFFFF000000AAFFFFFFFF00FFFF
     1422      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1423      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000AAFFFFFFFF00FFFF
     1424      FF00FFFFFF00FFFFFF00FFFFFF00000000FF000000FF000000FF000000FF0000
     1425      00FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFFFF000000AAFFFFFFFF00FFFF
     1426      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1427      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000AAFFFFFFFF00FFFF
     1428      FF00FFFFFF00000000FF000000FF000000FF000000FF000000FF000000FF0000
     1429      00FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFFFF000000AAFFFFFFFF00FFFF
     1430      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1431      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000AAD10000A838FFFF
     1432      FF00FFFFFF00FFFFFF000000ABA60000AB5B0000AA06FFFFFF00FFFFFF00FFFF
     1433      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000AB4C0000AAD10000
     1434      AAFF0000AAFF0000AAFF0000AAFF0000AAFF0000AADB0000AA1BFFFFFF00FFFF
     1435      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1436      FF00FFFFFF00FFFFFF000000ABA60000AB5B0000AA06FFFFFF00FFFFFF00FFFF
     1437      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1438      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1439      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1440      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1441      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000AB4C0000AAD10000
     1442      AAFF0000AAFF0000AAFF0000AAFF0000AAC0FFFFFF00FFFFFF00FFFFFF00FFFF
     1443      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000AAD10000A838FFFF
     1444      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1445      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000AAFFFFFFFF00FFFF
     1446      FF00FFFFFF00000000FF000000FF000000FF000000FF000000FF000000FF0000
     1447      00FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFFFF000000AAFFFFFFFF00FFFF
     1448      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1449      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000AAFFFFFFFF00FFFF
     1450      FF00FFFFFF00FFFFFF00FFFFFF00000000FF000000FF000000FF000000FF0000
     1451      00FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFFFF000000AAFFFFFFFF00FFFF
     1452      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1453      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000AAFFFFFFFF00FFFF
     1454      FF00FFFFFF00FFFFFF00FFFFFF00000000FF000000FF000000FF000000FF0000
     1455      00FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFFFF000000AAFFFFFFFF00FFFF
     1456      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1457      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000AAFFFFFFFF00FFFF
     1458      FF00FFFFFF00FFFFFF00FFFFFF00000000FF000000FF000000FF000000FF0000
     1459      00FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFFFF000000AAFFFFFFFF00FFFF
     1460      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1461      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000AAFFFFFFFF00FFFF
     1462      FF00FFFFFF00000000FF000000FF000000FF000000FF000000FF000000FF0000
     1463      00FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFFFF000000AAFFFFFFFF00FFFF
     1464      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1465      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000AAD10000A838FFFF
     1466      FF00FFFFFF00FFFFFF000000ABA60000AB5B0000AA06FFFFFF00FFFFFF00FFFF
     1467      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000AB4C0000AAD10000
     1468      AAFF0000AAFF0000AAFF0000AAFF0000AAFF0000AADB0000AA1BFFFFFF00FFFF
     1469      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     1470      FF00FFFFFF00FFFFFF000000ABA60000AB5B0000AA06FFFFFF00FFFFFF00FFFF
    13161471      FF00FFFFFF00FFFFFF00FFFFFF00
    13171472    }
     
    14221577      }
    14231578    end
     1579    object MenuItem36: TMenuItem
     1580      Action = AShowTargetPosition
     1581    end
     1582  end
     1583  object PopupMenuTarget: TPopupMenu
     1584    left = 92
     1585    top = 136
     1586    object MenuItem20: TMenuItem
     1587      Action = AShowSourcePosition
     1588    end
    14241589  end
    14251590end
  • trunk/Forms/UMainForm.lrt

    r32 r33  
    11TMAINFORM.CAPTION=LazFuck
    2 TMAINFORM.TOOLBUTTON12.CAPTION=ToolButton12
    3 TMAINFORM.TOOLBUTTON13.CAPTION=ToolButton13
    4 TMAINFORM.TOOLBUTTON14.CAPTION=ToolButton14
    5 TMAINFORM.TOOLBUTTON15.CAPTION=ToolButton15
     2TMAINFORM.TABSHEETSOURCE.CAPTION=Source code
     3TMAINFORM.TABSHEETTARGET.CAPTION=Target code
    64TMAINFORM.MENUITEM1.CAPTION=Project
    75TMAINFORM.MENUITEMOPENRECENT.CAPTION=Open recent
     
    2725TMAINFORM.APROGRAMSTOP.CAPTION=Stop
    2826TMAINFORM.AVIEWINTERPRETTER.CAPTION=Interpretter
    29 TMAINFORM.AVIEWCOMPILED.CAPTION=Compiled
    3027TMAINFORM.APROGRAMSTEPINTO.CAPTION=Step into
    3128TMAINFORM.APROGRAMSTEPOVER.CAPTION=Step over
     
    3835TMAINFORM.AGENERATENUMBER.CAPTION=Generate code for number
    3936TMAINFORM.AVIEWCOMPILERS.CAPTION=Compilers
     37TMAINFORM.ASHOWTARGETPOSITION.CAPTION=Show position in target
     38TMAINFORM.ASHOWSOURCEPOSITION.CAPTION=Show position in source
  • trunk/Forms/UMainForm.pas

    r32 r33  
    1818
    1919  TMainForm = class(TForm)
     20    AShowSourcePosition: TAction;
     21    AShowTargetPosition: TAction;
    2022    AProgramCompile: TAction;
    2123    AAbout: TAction;
     
    3133    AProgramStepOver: TAction;
    3234    AProgramStepInto: TAction;
    33     AViewCompiled: TAction;
    3435    AViewInterpretter: TAction;
    3536    AProgramPause: TAction;
     
    4748    ImageList1: TImageList;
    4849    MainMenu1: TMainMenu;
     50    MemoTarget: TMemo;
    4951    MemoSource: TMemo;
    5052    MenuItem1: TMenuItem;
     
    7678    MenuItem34: TMenuItem;
    7779    MenuItem35: TMenuItem;
     80    MenuItem36: TMenuItem;
    7881    MenuItemOpenRecent: TMenuItem;
    7982    MenuItemTarget: TMenuItem;
     
    8689    MenuItem9: TMenuItem;
    8790    OpenDialog1: TOpenDialog;
     91    PageControl1: TPageControl;
     92    PopupMenuTarget: TPopupMenu;
    8893    PopupMenuSource: TPopupMenu;
    8994    SaveDialog1: TSaveDialog;
    9095    StatusBar1: TStatusBar;
    91     TabControl1: TTabControl;
     96    TabSheetSource: TTabSheet;
     97    TabSheetTarget: TTabSheet;
    9298    ToolBar1: TToolBar;
    9399    ToolButton1: TToolButton;
     
    121127    procedure AProjectSaveExecute(Sender: TObject);
    122128    procedure AProgramRunExecute(Sender: TObject);
     129    procedure AShowSourcePositionExecute(Sender: TObject);
     130    procedure AShowTargetPositionExecute(Sender: TObject);
    123131    procedure AShrinkSourceExecute(Sender: TObject);
    124     procedure AViewCompiledExecute(Sender: TObject);
    125132    procedure AViewCompilersExecute(Sender: TObject);
    126133    procedure AViewInterpretterExecute(Sender: TObject);
     
    167174
    168175uses
    169   UInterpretterForm, UApplicationInfo, UCompiledForm, UOptionsForm,
     176  UInterpretterForm, UApplicationInfo, UOptionsForm,
    170177  UTargetDelphi, UTargetPHP, UTargetC, UCompilersForm;
    171178
     
    179186procedure TMainForm.FormShow(Sender: TObject);
    180187begin
     188  PageControl1.TabIndex := 0;
    181189  if OpenProjectOnStart and (LastOpenedList.Count > 0) then
    182190    ProjectOpen(LastOpenedList[0])
     
    188196begin
    189197  Modified := True;
     198  CurrentTarget.Compiled := False;
    190199  UpdateInterface;
    191200end;
     
    236245  UpdateInterface;
    237246  Modified := False;
     247  CurrentTarget.Compiled := False;
    238248end;
    239249
     
    247257    TTarget(Targets[I]).OnChangeState := nil;
    248258  FCurrentTarget.OnChangeState := BrainFuckInterpreterChangeState;
     259  UpdateInterface;
    249260end;
    250261
     
    364375  if CurrentTarget is TTargetInterpretter then
    365376    TTargetInterpretter(CurrentTarget).Input := InterpreterForm.MemoInput.Lines.Text;
    366   CurrentTarget.Source := MemoSource.Text;
     377  CurrentTarget.SourceCode := MemoSource.Text;
    367378  CurrentTarget.Run;
     379end;
     380
     381procedure TMainForm.AShowSourcePositionExecute(Sender: TObject);
     382var
     383  DebugStep: TDebugStep;
     384begin
     385  DebugStep := CurrentTarget.DebugSteps.SearchByTargetPos(MemoSource.SelStart);
     386  MemoTarget.SelStart := DebugStep.SourcePosition;
     387  PageControl1.TabIndex := 0;
     388end;
     389
     390procedure TMainForm.AShowTargetPositionExecute(Sender: TObject);
     391var
     392  DebugStep: TDebugStep;
     393begin
     394  DebugStep := CurrentTarget.DebugSteps.SearchBySourcePos(MemoSource.SelStart);
     395  MemoTarget.SelStart := DebugStep.TargetPosition;
     396  PageControl1.TabIndex := 1;
    368397end;
    369398
     
    384413  SetLength(Source, Pos - 1);
    385414  MemoSource.Text := Source;
    386 end;
    387 
    388 procedure TMainForm.AViewCompiledExecute(Sender: TObject);
    389 begin
    390   CompiledForm.Show;
    391415end;
    392416
     
    466490  with CurrentTarget do begin
    467491    Optimization := coNormal;
    468     Source := MemoSource.Text;
     492    SourceCode := MemoSource.Text;
    469493    ProgramName := ExtractFileNameOnly(ProjectFileName);
    470494    Compile;
    471     CompiledForm.MemoCompiled.Text := Output;
    472     CompiledForm.Show;
     495    MemoTarget.Text := TargetCode;
    473496  end;
    474497end;
     
    483506  with CurrentTarget do begin
    484507    Optimization := coNormal;
    485     Source := MemoSource.Text;
     508    SourceCode := MemoSource.Text;
    486509    ProgramName := ExtractFileNameOnly(ProjectFileName);
    487510    ProjectFileName := Self.ProjectFileName;
     
    515538  MemoSource.Clear;
    516539  Modified := False;
     540  CurrentTarget.Compiled := False;
    517541  UpdateInterface;
    518542end;
  • trunk/Languages/LazFuckIDE.cs.po

    r32 r33  
    180180msgstr "UloÅŸit jako..."
    181181
     182#: tmainform.ashowsourceposition.caption
     183msgid "Show position in source"
     184msgstr ""
     185
     186#: tmainform.ashowtargetposition.caption
     187msgid "Show position in target"
     188msgstr ""
     189
    182190#: tmainform.ashrinksource.caption
    183191msgid "Shrink source"
    184192msgstr "Srazit kód"
    185 
    186 #: tmainform.aviewcompiled.caption
    187 msgid "Compiled"
    188 msgstr "PřeloÅŸenÃœ"
    189193
    190194#: tmainform.aviewcompilers.caption
     
    242246msgstr "Cíl"
    243247
    244 #: tmainform.toolbutton12.caption
    245 msgid "ToolButton12"
    246 msgstr ""
    247 
    248 #: tmainform.toolbutton13.caption
    249 msgid "ToolButton13"
    250 msgstr ""
    251 
    252 #: tmainform.toolbutton14.caption
    253 msgid "ToolButton14"
    254 msgstr ""
    255 
    256 #: tmainform.toolbutton15.caption
    257 msgid "ToolButton15"
     248#: tmainform.tabsheetsource.caption
     249msgid "Source code"
     250msgstr ""
     251
     252#: tmainform.tabsheettarget.caption
     253msgid "Target code"
    258254msgstr ""
    259255
  • trunk/Languages/LazFuckIDE.po

    r32 r33  
    171171msgstr ""
    172172
     173#: tmainform.ashowsourceposition.caption
     174msgid "Show position in source"
     175msgstr ""
     176
     177#: tmainform.ashowtargetposition.caption
     178msgid "Show position in target"
     179msgstr ""
     180
    173181#: tmainform.ashrinksource.caption
    174182msgid "Shrink source"
    175 msgstr ""
    176 
    177 #: tmainform.aviewcompiled.caption
    178 msgid "Compiled"
    179183msgstr ""
    180184
     
    233237msgstr ""
    234238
    235 #: tmainform.toolbutton12.caption
    236 msgid "ToolButton12"
    237 msgstr ""
    238 
    239 #: tmainform.toolbutton13.caption
    240 msgid "ToolButton13"
    241 msgstr ""
    242 
    243 #: tmainform.toolbutton14.caption
    244 msgid "ToolButton14"
    245 msgstr ""
    246 
    247 #: tmainform.toolbutton15.caption
    248 msgid "ToolButton15"
     239#: tmainform.tabsheetsource.caption
     240msgid "Source code"
     241msgstr ""
     242
     243#: tmainform.tabsheettarget.caption
     244msgid "Target code"
    249245msgstr ""
    250246
  • trunk/LazFuckIDE.lpi

    r32 r33  
    3232            <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
    3333          </SearchPaths>
     34          <Parsing>
     35            <SyntaxOptions>
     36              <SyntaxMode Value="Delphi"/>
     37            </SyntaxOptions>
     38          </Parsing>
    3439          <CodeGeneration>
    3540            <SmartLinkUnit Value="True"/>
     
    8590      </Item5>
    8691    </RequiredPackages>
    87     <Units Count="12">
     92    <Units Count="11">
    8893      <Unit0>
    8994        <Filename Value="LazFuckIDE.lpr"/>
     
    97102      </Unit1>
    98103      <Unit2>
    99         <Filename Value="Forms\UCompiledForm.pas"/>
    100         <IsPartOfProject Value="True"/>
    101         <ComponentName Value="CompiledForm"/>
     104        <Filename Value="Forms\UMainForm.pas"/>
     105        <IsPartOfProject Value="True"/>
     106        <ComponentName Value="MainForm"/>
    102107        <HasResources Value="True"/>
    103108        <ResourceBaseClass Value="Form"/>
    104         <UnitName Value="UCompiledForm"/>
     109        <UnitName Value="UMainForm"/>
    105110      </Unit2>
    106111      <Unit3>
    107         <Filename Value="Forms\UMainForm.pas"/>
    108         <IsPartOfProject Value="True"/>
    109         <ComponentName Value="MainForm"/>
     112        <Filename Value="Forms\UOptionsForm.pas"/>
     113        <IsPartOfProject Value="True"/>
     114        <ComponentName Value="OptionsForm"/>
    110115        <HasResources Value="True"/>
    111116        <ResourceBaseClass Value="Form"/>
    112         <UnitName Value="UMainForm"/>
     117        <UnitName Value="UOptionsForm"/>
    113118      </Unit3>
    114119      <Unit4>
    115         <Filename Value="Forms\UOptionsForm.pas"/>
    116         <IsPartOfProject Value="True"/>
    117         <ComponentName Value="OptionsForm"/>
     120        <Filename Value="Forms\UInterpretterForm.pas"/>
     121        <IsPartOfProject Value="True"/>
     122        <ComponentName Value="InterpreterForm"/>
    118123        <HasResources Value="True"/>
    119124        <ResourceBaseClass Value="Form"/>
    120         <UnitName Value="UOptionsForm"/>
     125        <UnitName Value="UInterpretterForm"/>
    121126      </Unit4>
    122127      <Unit5>
    123         <Filename Value="Forms\UInterpretterForm.pas"/>
    124         <IsPartOfProject Value="True"/>
    125         <ComponentName Value="InterpreterForm"/>
    126         <HasResources Value="True"/>
    127         <ResourceBaseClass Value="Form"/>
    128         <UnitName Value="UInterpretterForm"/>
     128        <Filename Value="Forms\UCompilersForm.pas"/>
     129        <IsPartOfProject Value="True"/>
     130        <ComponentName Value="FormCompilers"/>
     131        <ResourceBaseClass Value="Form"/>
     132        <UnitName Value="UCompilersForm"/>
    129133      </Unit5>
    130134      <Unit6>
    131         <Filename Value="Forms\UCompilersForm.pas"/>
    132         <IsPartOfProject Value="True"/>
    133         <ComponentName Value="FormCompilers"/>
    134         <ResourceBaseClass Value="Form"/>
    135         <UnitName Value="UCompilersForm"/>
     135        <Filename Value="Target\UTarget.pas"/>
     136        <IsPartOfProject Value="True"/>
     137        <UnitName Value="UTarget"/>
    136138      </Unit6>
    137139      <Unit7>
    138         <Filename Value="Target\UTarget.pas"/>
    139         <IsPartOfProject Value="True"/>
    140         <UnitName Value="UTarget"/>
     140        <Filename Value="Target\UTargetC.pas"/>
     141        <IsPartOfProject Value="True"/>
     142        <UnitName Value="UTargetC"/>
    141143      </Unit7>
    142144      <Unit8>
    143         <Filename Value="Target\UTargetC.pas"/>
    144         <IsPartOfProject Value="True"/>
    145         <UnitName Value="UTargetC"/>
     145        <Filename Value="Target\UTargetDelphi.pas"/>
     146        <IsPartOfProject Value="True"/>
     147        <UnitName Value="UTargetDelphi"/>
    146148      </Unit8>
    147149      <Unit9>
    148         <Filename Value="Target\UTargetDelphi.pas"/>
    149         <IsPartOfProject Value="True"/>
    150         <UnitName Value="UTargetDelphi"/>
     150        <Filename Value="Target\UTargetInterpretter.pas"/>
     151        <IsPartOfProject Value="True"/>
     152        <UnitName Value="UTargetInterpretter"/>
    151153      </Unit9>
    152154      <Unit10>
    153         <Filename Value="Target\UTargetInterpretter.pas"/>
    154         <IsPartOfProject Value="True"/>
    155         <UnitName Value="UTargetInterpretter"/>
     155        <Filename Value="Target\UTargetPHP.pas"/>
     156        <IsPartOfProject Value="True"/>
     157        <UnitName Value="UTargetPHP"/>
    156158      </Unit10>
    157       <Unit11>
    158         <Filename Value="Target\UTargetPHP.pas"/>
    159         <IsPartOfProject Value="True"/>
    160         <UnitName Value="UTargetPHP"/>
    161       </Unit11>
    162159    </Units>
    163160  </ProjectOptions>
     
    173170      <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
    174171    </SearchPaths>
     172    <Parsing>
     173      <SyntaxOptions>
     174        <SyntaxMode Value="Delphi"/>
     175      </SyntaxOptions>
     176    </Parsing>
    175177    <CodeGeneration>
    176178      <Checks>
  • trunk/LazFuckIDE.lpr

    r32 r33  
    1010  Interfaces, // this includes the LCL widgetset
    1111  Forms, UApplicationInfo, UTarget, UTargetC, UTargetDelphi,
    12   UTargetInterpretter, UTargetPHP, UCompiledForm, UInterpretterForm, UMainForm,
     12  UTargetInterpretter, UTargetPHP, UInterpretterForm, UMainForm,
    1313  UOptionsForm, CoolTranslator, Common,
    1414  TemplateGenerics, UCompilersForm;
     
    2121  Application.Initialize;
    2222  Application.CreateForm(TMainForm, MainForm);
    23   Application.CreateForm(TCompiledForm, CompiledForm);
    2423  Application.CreateForm(TInterpreterForm, InterpreterForm);
    2524  Application.CreateForm(TOptionsForm, OptionsForm);
  • trunk/Target/UTarget.pas

    r32 r33  
    1818  TRunState = (rsStopped, rsPaused, rsRunning);
    1919
     20  TStepOperation = (soNormal, soStepIn, soStepOut);
     21
     22  TDebugStep = class
     23    SourcePosition: Integer;
     24    TargetPosition: Integer;
     25    Operation: TStepOperation;
     26  end;
     27
     28  { TDebugStepList }
     29
     30  TDebugStepList = class(TListObject)
     31    function SearchBySourcePos(Pos: Integer): TDebugStep;
     32    function SearchByTargetPos(Pos: Integer): TDebugStep;
     33    procedure AddStep(SourcePos, TargetPos: Integer; Operation: TStepOperation);
     34  end;
     35
    2036  { TTarget }
    2137
    2238  TTarget = class
    2339  private
     40    FCompiled: Boolean;
    2441  protected
    25     FSource: string;
     42    FSourceCode: string;
     43    FTargetCode: string;
    2644    Indent: Integer;
    2745    FState: TRunState;
    2846    FOnChangeState: TNotifyEvent;
    29     procedure SetSource(AValue: string); virtual;
     47    procedure SetSourceCode(AValue: string); virtual;
     48    function GetTargetCode: string; virtual;
    3049    procedure AddLine(Text: string);
    3150    function LongFileName(FileName: string): string;
     
    3352    Name: string;
    3453    ProgramName: string;
    35     Output: string;
    3654    Optimization: TCompilerOptimization;
    3755    CompilerPath: string;
     
    4058    ProjectFileName: string;
    4159    Capabilities: TTargetCapabilities;
     60    BreakPointers: TListInteger;
     61    DebugSteps: TDebugStepList;
    4262    constructor Create; virtual;
     63    destructor Destroy; override;
    4364    procedure OptimizeSource;
    4465    procedure Compile; virtual;
     
    5576    property State: TRunState read FState;
    5677    property OnChangeState: TNotifyEvent read FOnChangeState write FOnChangeState;
    57     property Source: string write SetSource;
     78    property SourceCode: string write SetSourceCode;
     79    property TargetCode: string read GetTargetCode;
     80    property Compiled: Boolean read FCompiled write FCompiled;
    5881  end;
    5982
     
    7396
    7497implementation
     98
     99{ TDebugStepList }
     100
     101function TDebugStepList.SearchBySourcePos(Pos: Integer
     102  ): TDebugStep;
     103var
     104  I: Integer;
     105begin
     106  I := 0;
     107  while (I < Count) and (TDebugStep(Items[I]).SourcePosition < Pos) do Inc(I);
     108  if I < Count then Result := TDebugStep(Items[I])
     109    else Result := nil;
     110end;
     111
     112function TDebugStepList.SearchByTargetPos(Pos: Integer
     113  ): TDebugStep;
     114var
     115  I: Integer;
     116begin
     117  I := 0;
     118  while (I < Count) and (TDebugStep(Items[I]).TargetPosition < Pos) do Inc(I);
     119  if I < Count then Result := TDebugStep(Items[I])
     120    else Result := nil;
     121end;
     122
     123procedure TDebugStepList.AddStep(SourcePos, TargetPos: Integer;
     124  Operation: TStepOperation);
     125var
     126  NewItem: TDebugStep;
     127begin
     128  NewItem := TDebugStep.Create;
     129  NewItem.SourcePosition := SourcePos;
     130  NewItem.TargetPosition := TargetPos;
     131  NewItem.Operation := Operation;
     132  Add(NewItem);
     133end;
    75134
    76135
     
    122181{ TTarget }
    123182
    124 procedure TTarget.SetSource(AValue: string);
    125 begin
    126   FSource := AValue;
     183function TTarget.GetTargetCode: string;
     184begin
     185  Result := FTargetCode;
     186end;
     187
     188procedure TTarget.SetSourceCode(AValue: string);
     189begin
     190  FSourceCode := AValue;
    127191end;
    128192
    129193procedure TTarget.AddLine(Text: string);
    130194begin
    131   Output := Output + DupeString('  ', Indent) + Text + LineEnding;
     195  FTargetCode := FTargetCode + DupeString('  ', Indent) + Text + LineEnding;
    132196end;
    133197
     
    145209constructor TTarget.Create;
    146210begin
     211  inherited;
    147212  Optimization := coNormal;
     213  BreakPointers := TListInteger.Create;
     214  DebugSteps := TDebugStepList.Create;
     215end;
     216
     217destructor TTarget.Destroy;
     218begin
     219  DebugSteps.Free;;
     220  BreakPointers.Free;
     221  inherited Destroy;
    148222end;
    149223
     
    156230procedure TTarget.Compile;
    157231begin
    158 
     232  Compiled := True;
    159233end;
    160234
     
    170244  with TStringList.Create do
    171245  try
    172     Text := Output;
     246    Text := FTargetCode;
    173247    SaveToFile(CompiledFile);
    174248  finally
  • trunk/Target/UTargetC.pas

    r32 r33  
    5050  Result := 1;
    5151  if Optimization = coNormal then
    52   while ((I + 1) <= Length(FSource)) and (FSource[I + 1] = C) do begin
     52  while ((I + 1) <= Length(FSourceCode)) and (FSourceCode[I + 1] = C) do begin
    5353    Inc(Result);
    5454    Inc(I)
     
    5858begin
    5959  Indent := 0;
    60   Output := '';
     60  FTargetCode := '';
    6161
    6262  AddLine('#include <stdio.h>');
     
    7171  AddLine('Pos = 0;');
    7272  I := 1;
    73   while (I <= Length(FSource)) do begin
    74     case FSource[I] of
     73  while (I <= Length(FSourceCode)) do begin
     74    case FSourceCode[I] of
    7575      '>': begin
    7676        Sum := CheckOccurence('>');
     
    119119  with TStringList.Create do
    120120  try
    121     Text := Output;
     121    Text := FTargetCode;
    122122    SaveToFile(CompiledFile);
    123123  finally
  • trunk/Target/UTargetDelphi.pas

    r32 r33  
    4444  Result := 1;
    4545  if Optimization = coNormal then
    46   while ((I + 1) <= Length(FSource)) and (FSource[I + 1] = C) do begin
     46  while ((I + 1) <= Length(FSourceCode)) and (FSourceCode[I + 1] = C) do begin
    4747    Inc(Result);
    4848    Inc(I)
     
    5252begin
    5353  Indent := 0;
    54   Output := '';
     54  FTargetCode := '';
    5555
    5656  AddLine('program ' + ProgramName + ';');
     
    6666  AddLine('Pos := 0;');
    6767  I := 1;
    68   while (I <= Length(FSource)) do begin
    69     case FSource[I] of
     68  while (I <= Length(FSourceCode)) do begin
     69    case FSourceCode[I] of
    7070      '>': begin
    7171        Sum := CheckOccurence('>');
  • trunk/Target/UTargetInterpretter.pas

    r32 r33  
    1818  end;
    1919
    20   TBrainFuckCommand = (cmNone, cmInc, cmDec, cmPointerInc, cmPointerDec,
    21     cmOutput, cmInput, cmLoopStart, cmLoopEnd);
     20  TBrainFuckCommand = (cmNoOperation, cmInc, cmDec, cmPointerInc, cmPointerDec,
     21    cmOutput, cmInput, cmLoopStart, cmLoopEnd, cmDebug);
    2222
    2323  TCommandHandler = procedure of object;
     
    4545    procedure CommandLoopStart;
    4646    procedure CommandLoopEnd;
     47    procedure SingleStep;
     48    procedure Reset;
    4749  protected
    48     procedure SetSource(AValue: string); override;
     50    function GetTargetCode: string; override;
    4951  public
    50     FSource: array of TBrainFuckCommand;
     52    FProgram: array of TBrainFuckCommand;
    5153    SourceJump: array of Integer;
    5254    SourcePosition: Integer;
     
    5860    Input: string;
    5961    InputPosition: Integer;
    60     procedure Reset;
    61     procedure SingleStep;
     62    procedure Compile; override;
    6263    procedure Run; override;
    6364    procedure Pause; override;
     
    7273  end;
    7374
     75const
     76  BrainFuckCommandText: array[TBrainFuckCommand] of Char = (
     77    ' ', '+', '-', '>', '<', '.', ',', '[', ']', '@');
     78
    7479
    7580implementation
     
    8893begin
    8994  repeat
    90     while (Parent.SourcePosition < Length(Parent.FSource)) and (Parent.State <> rsStopped) do begin
     95    while (Parent.SourcePosition < Length(Parent.FProgram)) and (Parent.State <> rsStopped) do begin
    9196      Parent.SingleStep;
    9297      while Parent.State = rsPaused do begin
     
    117122end;
    118123
    119 procedure TTargetInterpretter.SetSource(AValue: string);
     124procedure TTargetInterpretter.Compile;
    120125var
    121126  I: Integer;
    122127  Pos: Integer;
    123128begin
    124   SetLength(FSource, Length(AValue));
     129  DebugSteps.Clear;
     130  SetLength(FProgram, Length(FSourceCode));
    125131  Pos := 0;
    126   for I := 1 to Length(AValue) do begin
    127     case AValue[I] of
    128       '+': FSource[Pos] := cmInc;
    129       '-': FSource[Pos] := cmDec;
    130       '>': FSource[Pos] := cmPointerInc;
    131       '<': FSource[Pos] := cmPointerDec;
    132       ',': FSource[Pos] := cmInput;
    133       '.': FSource[Pos] := cmOutput;
    134       '[': FSource[Pos] := cmLoopStart;
    135       ']': FSource[Pos] := cmLoopEnd;
     132  for I := 1 to Length(FSourceCode) do begin
     133    case FSourceCode[I] of
     134      '+': begin
     135        FProgram[Pos] := cmInc;
     136        DebugSteps.AddStep(I - 1, Pos, soNormal);
     137      end;
     138      '-': begin
     139        FProgram[Pos] := cmDec;
     140        DebugSteps.AddStep(I - 1, Pos, soNormal);
     141      end;
     142      '>': begin
     143        FProgram[Pos] := cmPointerInc;
     144        DebugSteps.AddStep(I - 1, Pos, soNormal);
     145      end;
     146      '<': begin
     147        FProgram[Pos] := cmPointerDec;
     148        DebugSteps.AddStep(I - 1, Pos, soNormal);
     149      end;
     150      ',': begin
     151        FProgram[Pos] := cmInput;
     152        DebugSteps.AddStep(I - 1, Pos, soNormal);
     153      end;
     154      '.': begin
     155        FProgram[Pos] := cmOutput;
     156        DebugSteps.AddStep(I - 1, Pos, soNormal);
     157      end;
     158      '[': begin
     159        FProgram[Pos] := cmLoopStart;
     160        DebugSteps.AddStep(I - 1, Pos, soStepIn);
     161      end;
     162      ']': begin
     163        FProgram[Pos] := cmLoopEnd;
     164        DebugSteps.AddStep(I - 1, Pos, soStepOut);
     165      end
    136166      else Dec(Pos);
    137167    end;
    138168    Inc(Pos);
    139169  end;
    140   SetLength(FSource, Pos);
     170  SetLength(FProgram, Pos);
    141171end;
    142172
     
    160190  I: Integer;
    161191begin
    162   SetLength(SourceJump, Length(FSource));
     192  SetLength(SourceJump, Length(FProgram));
    163193  //FillChar(Pointer(SourceJump)^, Length(SourceJump), 0);
    164   for I := 0 to Length(FSource) - 1 do
     194  for I := 0 to Length(FProgram) - 1 do
    165195    SourceJump[I] := 0;
    166196  SetLength(Loop, 0);
    167   for I := 0 to Length(FSource) - 1 do begin
    168     case FSource[I] of
     197  for I := 0 to Length(FProgram) - 1 do begin
     198    case FProgram[I] of
    169199      cmLoopStart: begin
    170200        SetLength(Loop, Length(Loop) + 1);
     
    252282end;
    253283
     284function TTargetInterpretter.GetTargetCode: string;
     285var
     286  I: Integer;
     287begin
     288  SetLength(Result, Length(FProgram));
     289  for I := 0 to Length(FProgram) - 1 do
     290    Result[I + 1] := BrainFuckCommandText[FProgram[I]];
     291end;
     292
    254293procedure TTargetInterpretter.SingleStep;
    255294begin
    256   FCommandTable[FSource[SourcePosition]];
     295  FCommandTable[FProgram[SourcePosition]];
    257296  Inc(SourcePosition);
    258297  Inc(FStepCount);
     
    281320  inherited;
    282321  Name := 'Interpretter';
    283   Capabilities := [tcRun, tcPause, tcStop];
     322  Capabilities := [tcRun, tcPause, tcStop, tcCompile, tcStepOut, tcStepInto,
     323    tcStepOver, tcRunToCursor];
    284324  MemorySize := 30000;
    285325  CellSize := 256;
  • trunk/Target/UTargetPHP.pas

    r32 r33  
    4848  Result := 1;
    4949  if Optimization = coNormal then
    50   while ((I + 1) <= Length(FSource)) and (FSource[I + 1] = C) do begin
     50  while ((I + 1) <= Length(FSourceCode)) and (FSourceCode[I + 1] = C) do begin
    5151    Inc(Result);
    5252    Inc(I)
     
    5656begin
    5757  Indent := 0;
    58   Output := '';
     58  FTargetCode := '';
    5959
    6060  AddLine('<?php // ' + ProgramName);
     
    6262  AddLine('$Memory = str_repeat("\0", 30000);');
    6363  AddLine('$Position = 0;');
    64   for I := 1 to Length(FSource) do begin
    65     case FSource[I] of
     64  for I := 1 to Length(FSourceCode) do begin
     65    case FSourceCode[I] of
    6666      '>': begin
    6767        Sum := CheckOccurence('>');
Note: See TracChangeset for help on using the changeset viewer.