Ignore:
Timestamp:
Feb 2, 2017, 11:35:09 PM (8 years ago)
Author:
chronos
Message:
  • Modified: Improved parsin and prepared analyzed source execution.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/interpreter/Source3.pas

    r96 r97  
    4949  TFunctionCall = procedure ;
    5050
     51  TCmdType = (ctWhileDo, ctIfThenElse, ctBeginEnd, ctAssignment, ctExecution);
    5152  TCommand = record
    52   end;
     53    CmdType: TCmdType;
     54    Ptr: Pointer;
     55{    case Integer of
     56      0: (WhileDo: TWhileDo);
     57      1: (IfThenElse: TIfThenElse);
     58      2: (BeginEnd: TBeginEnd);
     59      3: (Assignment: TAssignment);
     60      4: (Execution: TExecution);
     61    end;
     62 } end;
    5363  PCommand = ^TCommand;
    5464
    5565  TBeginEnd = record
    56     Commands: array of PCommand;
     66    Commands: array of TCommand;
    5767  end;
    5868  PBeginEnd = ^TBeginEnd;
     
    6676    Source: TExpression;
    6777  end;
     78  PAssignment = ^TAssignment;
    6879
    6980  TIfThenElse = record
     
    7384  end;
    7485  PIfThenElse = ^TIfThenElse;
     86
     87  TWhileDo = record
     88    Condition: TExpression;
     89    Command: TCommand;
     90  end;
     91  PWhileDo = ^TWhileDo;
    7592
    7693  { TFunction }
     
    93110  end;
    94111
     112  TExecutionParams = record
     113    Items: array of TExpression;
     114  end;
     115
     116  TExecution = record
     117    Func: PFunction;
     118    Parameters: TExecutionParams;
     119  end;
     120  PExecution = ^TExecution;
     121
    95122  TProgramCode = record
    96123    Name: string;
Note: See TracChangeset for help on using the changeset viewer.