Changeset 57


Ignore:
Timestamp:
Jul 16, 2012, 4:11:47 PM (12 years ago)
Author:
chronos
Message:
  • Modified: Testing interpretter.
Location:
trunk
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/Compiler/Analyze/UAnalyzerPascal.pas

    r51 r57  
    150150          ReadToken;
    151151        end;
     152        ShowMessage(IntToStr(TExpression(Expressions.Last).SubItems.Count) + ' ' + TExpression(Expressions.Last).OperatorName);
     153        if Assigned(TExpression(Expressions.First)) then
     154          ShowMessage('First ' + IntToStr(Integer(TExpression(Expressions.Last).SubItems.First)));
     155        if Assigned(TExpression(Expressions.Last)) then
     156          ShowMessage('Last ' + IntToStr(Integer(TExpression(Expressions.Last).SubItems.Last)));
    152157      end;
    153158
     
    169174        Assign(TExpression(TExpression(Expressions.First).SubItems.Last));
    170175      TExpression(Expressions.First).SubItems.Last := nil;
    171       //ShowMessage(IntToStr(Expressions.Count));
    172176      if Expressions.Count > 1 then
    173177        TExpression(Expressions[1]).SubItems.First := nil;
  • trunk/Compiler/Target/Interpretter/UTargetInterpretter.pas

    r56 r57  
    128128
    129129function TExecutorInterpretter.Evaluate(Expression: TExpression): TValue;
     130var
     131  I: Integer;
    130132begin
    131133  with Expression do
     
    149151    end;
    150152    ntVariable: Result := Variable.Value;
     153    ntValue: Result := Value;
    151154  end;
    152155end;
  • trunk/Compiler/TranspascalCompiler.lpk

    r56 r57  
    5656      </Item7>
    5757      <Item8>
     58        <Filename Value="Target\UTargets.pas"/>
     59        <UnitName Value="UTargets"/>
     60      </Item8>
     61      <Item9>
    5862        <Filename Value="Target\Dynamic C\UProducerDynamicc.pas"/>
    5963        <UnitName Value="UProducerDynamicC"/>
    60       </Item8>
    61       <Item9>
     64      </Item9>
     65      <Item10>
    6266        <Filename Value="Target\ASM8051\UProducerASM8051.pas"/>
    6367        <UnitName Value="UProducerAsm8051"/>
    64       </Item9>
    65       <Item10>
     68      </Item10>
     69      <Item11>
     70        <Filename Value="Target\ASM8051\UTargetASM8051.pas"/>
     71        <UnitName Value="UTargetASM8051"/>
     72      </Item11>
     73      <Item12>
    6674        <Filename Value="Target\GCC\UProducerGCC.pas"/>
    6775        <UnitName Value="UProducerGCC"/>
    68       </Item10>
    69       <Item11>
    70         <Filename Value="Target\UTargets.pas"/>
    71         <UnitName Value="UTargets"/>
    72       </Item11>
    73       <Item12>
     76      </Item12>
     77      <Item13>
     78        <Filename Value="Target\GCC\UTargetGCC.pas"/>
     79        <UnitName Value="UTargetGCC"/>
     80      </Item13>
     81      <Item14>
    7482        <Filename Value="Target\Delphi\UProducerPascal.pas"/>
    7583        <UnitName Value="UProducerPascal"/>
    76       </Item12>
    77       <Item13>
     84      </Item14>
     85      <Item15>
     86        <Filename Value="Target\Delphi\UTargetDelphi.pas"/>
     87        <UnitName Value="UTargetDelphi"/>
     88      </Item15>
     89      <Item16>
     90        <Filename Value="Target\PHP\UTargetPHP.pas"/>
     91        <UnitName Value="UTargetPHP"/>
     92      </Item16>
     93      <Item17>
     94        <Filename Value="Target\Java\UTargetJava.pas"/>
     95        <UnitName Value="UTargetJava"/>
     96      </Item17>
     97      <Item18>
     98        <Filename Value="Target\XML\UTargetXML.pas"/>
     99        <UnitName Value="UTargetXML"/>
     100      </Item18>
     101      <Item19>
    78102        <Filename Value="Target\Interpretter\UTargetInterpretter.pas"/>
    79103        <UnitName Value="UTargetInterpretter"/>
    80       </Item13>
    81       <Item14>
    82         <Filename Value="Target\Delphi\UTargetDelphi.pas"/>
    83         <UnitName Value="UTargetDelphi"/>
    84       </Item14>
    85       <Item15>
    86         <Filename Value="Target\PHP\UTargetPHP.pas"/>
    87         <UnitName Value="UTargetPHP"/>
    88       </Item15>
    89       <Item16>
    90         <Filename Value="Target\Java\UTargetJava.pas"/>
    91         <UnitName Value="UTargetJava"/>
    92       </Item16>
    93       <Item17>
    94         <Filename Value="Target\XML\UTargetXML.pas"/>
    95         <UnitName Value="UTargetXML"/>
    96       </Item17>
    97       <Item18>
    98         <Filename Value="Target\ASM8051\UTargetASM8051.pas"/>
    99         <UnitName Value="UTargetASM8051"/>
    100       </Item18>
    101       <Item19>
    102         <Filename Value="Target\GCC\UTargetGCC.pas"/>
    103         <UnitName Value="UTargetGCC"/>
    104104      </Item19>
    105105    </Files>
  • trunk/Compiler/TranspascalCompiler.pas

    r56 r57  
    99uses
    1010  UCompiler, USourceCode, UProducer, UAnalyzer, UTarget, UExecutor,
    11   UAnalyzerPascal, UProducerDynamicc, UProducerASM8051, UProducerGCC,
    12   UTargets, UProducerPascal, UTargetInterpretter, UTargetDelphi, UTargetPHP,
    13   UTargetJava, UTargetXML, UTargetASM8051, UTargetGCC, LazarusPackageIntf;
     11  UAnalyzerPascal, UTargets, UProducerDynamicc, UProducerASM8051,
     12  UTargetASM8051, UProducerGCC, UTargetGCC, UProducerPascal, UTargetDelphi,
     13  UTargetPHP, UTargetJava, UTargetXML, UTargetInterpretter, LazarusPackageIntf;
    1414
    1515implementation
  • trunk/IDE/Forms/UFormMain.lfm

    r54 r57  
    11object FormMain: TFormMain
    2   Left = 217
     2  Left = 140
    33  Height = 501
    4   Top = 104
     4  Top = 52
    55  Width = 695
    66  Caption = 'Transpascal IDE'
  • trunk/IDE/Forms/UFormMessages.lfm

    r45 r57  
    77  ClientHeight = 251
    88  ClientWidth = 415
    9   LCLVersion = '0.9.31'
     9  LCLVersion = '1.1'
    1010  object ListView1: TListView
    1111    Left = 0
  • trunk/IDE/Forms/UFormMessages.pas

    r53 r57  
    7272    ProjectFile := Project.Files.SearchFile(FileName);
    7373    if Assigned(ProjectFile) then
    74       SynEditSource.Lines.Assign(ProjectFile.Source);
     74      SynEditSource.Lines.Assign(ProjectFile.Source)
     75      else if FileExistsUTF8(FileName) then
     76        SynEditSource.Lines.LoadFromFile(FileName);
    7577    SynEditSource.CaretXY := Position;
    7678    TForm(SynEditSource.Owner).Show;
  • trunk/IDE/Forms/UFormProject.lfm

    r56 r57  
    11object FormProject: TFormProject
    2   Left = 505
     2  Left = 507
    33  Height = 253
    4   Top = 195
     4  Top = 197
    55  Width = 331
    66  Caption = 'Project manager'
  • trunk/IDE/Forms/UFormProjectNew.lfm

    r48 r57  
    88  ClientWidth = 519
    99  OnShow = FormShow
    10   LCLVersion = '0.9.31'
     10  LCLVersion = '1.1'
    1111  object ButtonOk: TButton
    1212    Left = 424
     
    4040    ViewStyle = vsIcon
    4141    OnChange = ListView1Change
     42    OnDblClick = ListView1DblClick
    4243    OnSelectItem = ListView1SelectItem
    4344  end
  • trunk/IDE/Forms/UFormProjectNew.pas

    r53 r57  
    2020    procedure ListView1Change(Sender: TObject; Item: TListItem;
    2121      Change: TItemChange);
     22    procedure ListView1DblClick(Sender: TObject);
    2223    procedure ListView1SelectItem(Sender: TObject; Item: TListItem;
    2324      Selected: Boolean);
     
    5253end;
    5354
     55procedure TFormProjectNew.ListView1DblClick(Sender: TObject);
     56begin
     57  ButtonOk.Click;
     58end;
     59
    5460procedure TFormProjectNew.ListView1SelectItem(Sender: TObject; Item: TListItem;
    5561  Selected: Boolean);
  • trunk/IDE/Forms/UFormSourceCode.lfm

    r53 r57  
    11object FormSourceCode: TFormSourceCode
    2   Left = 352
     2  Left = 353
    33  Height = 426
    4   Top = 95
     4  Top = 97
    55  Width = 535
    66  Caption = 'Source code'
  • trunk/IDE/Forms/UFormSourceCode.pas

    r54 r57  
    4040procedure TFormSourceCode.SynEditSourceChange(Sender: TObject);
    4141begin
    42   if Assigned(Core.Project) then
     42  if Assigned(Core.Project) and Assigned(ProjectFile) then
    4343    ProjectFile.Modified := True;
    4444end;
  • trunk/IDE/Forms/UFormTargetProject.lfm

    r53 r57  
    11object FormTargetProject: TFormTargetProject
    2   Left = 256
     2  Left = 258
    33  Height = 240
    4   Top = 81
     4  Top = 83
    55  Width = 320
    66  Caption = 'FormTargetProject'
  • trunk/IDE/Transpascal.lpi

    r55 r57  
    150150        <IsPartOfProject Value="True"/>
    151151        <ComponentName Value="FormMessages"/>
     152        <HasResources Value="True"/>
    152153        <ResourceBaseClass Value="Form"/>
    153154        <UnitName Value="UFormMessages"/>
     
    202203        <IsPartOfProject Value="True"/>
    203204        <ComponentName Value="FormProjectNew"/>
     205        <HasResources Value="True"/>
    204206        <ResourceBaseClass Value="Form"/>
    205207        <UnitName Value="UFormProjectNew"/>
  • trunk/IDE/UCore.lfm

    r55 r57  
    44  OldCreateOrder = False
    55  Height = 290
    6   HorizontalOffset = 308
    7   VerticalOffset = 75
     6  HorizontalOffset = 309
     7  VerticalOffset = 77
    88  Width = 347
    99  object LastOpenedFiles: TLastOpenedList
  • trunk/IDE/UCore.pas

    r55 r57  
    2828    procedure LastOpenedFilesChange(Sender: TObject);
    2929  private
     30    procedure ProjectChange(Sender: TObject);
    3031  public
    3132    ReopenLastOpenedFile: Boolean;
     
    6869  Project := TProject.Create;
    6970  Project.FileName := SNewProject;
     71  Project.OnChange := ProjectChange;
    7072end;
    7173
     
    109111  LastOpenedFiles.LoadToMenuItem(FormMain.PopupMenu1.Items,
    110112    FormMain.OpenRecentClick);
     113end;
     114
     115procedure TCore.ProjectChange(Sender: TObject);
     116begin
     117  FormMain.UpdateInterface;
    111118end;
    112119
  • trunk/IDE/UProject.pas

    r54 r57  
    7373  TProject = class
    7474  private
    75     FActive: Boolean;
    7675    FModified: Boolean;
    7776    FOnChange: TNotifyEvent;
     
    239238var
    240239  I: Integer;
    241 begin
     240  ParentDir: string;
     241begin
     242  ParentDir := ExtractFileDir(Parent.FileName);
     243  if Copy(FileName, 1, Length(ParentDir)) = ParentDir then
     244    System.Delete(FileName, 1, Length(ParentDir) + 1);
    242245  I := 0;
    243246  while (I < Count) and (TProjectFile(Items[I]).FileName <> FileName) do Inc(I);
     
    309312procedure TProjectFile.Save;
    310313begin
    311   if Modified then
    312     Source.SaveToFile(FileName);
     314  Source.SaveToFile(AbsoluteFileName);
    313315end;
    314316
     
    319321  if FModified = AValue then Exit;
    320322  FModified := AValue;
     323  if Assigned(FOnChange) then FOnChange(Self);
    321324end;
    322325
     
    364367begin
    365368  Doc := TXMLDocument.Create;
     369  Self.FileName := FileName;
    366370  with Doc do try
    367371    RootNode := CreateElement('Project');
     
    395399
    396400procedure TProject.Save;
     401var
     402  I: Integer;
    397403begin
    398404  Files.Save;
    399405  Packages.Save;
     406  for I := 0 to Files.Count - 1 do
     407    TProjectFile(Files[I]).Modified := False;
     408  Modified := False;
    400409end;
    401410
Note: See TracChangeset for help on using the changeset viewer.