Ignore:
Timestamp:
Nov 9, 2009, 9:47:57 AM (15 years ago)
Author:
george
Message:
  • Upraveno: Zobecněno uchování definic parametrických povelů v bloku BeginEnd pro potřeby generování do různých jazyků.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Void/UCompilator.pas

    r7 r8  
    6262  VariableName: string;
    6363begin
    64   with Model do begin
     64  with Model, BeginEnd do begin
    6565  Command := Parse(Line);
    6666  if Command = 'Write' then
    6767  with TCommand(Commands[Commands.Add(TCommand.Create)]) do begin
    68     Text := 'WriteLn(''' + Line + ''');';
     68    Name := 'WriteLn';
     69    Parameters.Add(Parse(Line));
    6970  end else if Command = 'Define' then begin
    7071    VariableName := Parse(Line);
     
    8485    if not Assigned(Variable) then DoError('Undefined variable ' + VariableName)
    8586    else begin
    86       Text := VariableName + ' := ''' + Parse(Line) + ''';';
     87      Name := 'Assignment';
     88      Parameters.Add(VariableName);
     89      Parameters.Add(Parse(Line));
    8790    end;
    8891  end else if Command = 'Pause' then with TCommand(Commands[Commands.Add(TCommand.Create)]) do begin
    89     Text := 'ReadLn;';
     92    Name := 'ReadLn';
    9093  end else if Command = 'Exit' then with TCommand(Commands[Commands.Add(TCommand.Create)]) do begin
    91     Text := 'Exit;';
     94    Name := 'Exit';
    9295  end else DoError('Unknown command ' + Command);
    9396
Note: See TracChangeset for help on using the changeset viewer.