Ignore:
Timestamp:
Apr 17, 2020, 11:07:37 PM (5 years ago)
Author:
chronos
Message:
  • Added: Simple PHP code generator.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/interpreter2/UFormMain.pas

    r203 r204  
    1515  TFormMain = class(TForm)
    1616    ButtonCompile: TButton;
     17    ButtonGenerate1: TButton;
    1718    ButtonRun: TButton;
    1819    ButtonGenerate: TButton;
     
    2425    SynFreePascalSyn1: TSynFreePascalSyn;
    2526    procedure ButtonCompileClick(Sender: TObject);
     27    procedure ButtonGenerate1Click(Sender: TObject);
    2628    procedure ButtonGenerateClick(Sender: TObject);
    2729    procedure ButtonRunClick(Sender: TObject);
     
    4951
    5052uses
    51   UParser, UExecutor, UGenerator;
     53  UParser, UExecutor, UGenerator, UGeneratorPhp;
    5254
    5355{ TFormMain }
     
    107109end;
    108110
     111procedure TFormMain.ButtonGenerate1Click(Sender: TObject);
     112var
     113  Generator: TGeneratorPhp;
     114begin
     115  ButtonCompile.Click;
     116  MemoOutput.Lines.Clear;
     117  if Assigned(Prog) then begin
     118    Generator := TGeneratorPhp.Create;
     119    Generator.Prog := Prog;
     120    Generator.Generate;
     121    MemoOutput.Lines.Text := Generator.Output;
     122    Generator.Free;
     123  end;
     124end;
     125
    109126procedure TFormMain.ButtonGenerateClick(Sender: TObject);
    110127var
Note: See TracChangeset for help on using the changeset viewer.