Ignore:
Timestamp:
Jan 17, 2018, 2:25:45 PM (6 years ago)
Author:
chronos
Message:
  • Modified: ParseBeginEnd method split to several other items for parsing each specific command.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/easy compiler/USourceCode.pas

    r145 r146  
    99
    1010type
    11   TSourceInstruction = class
     11  TSourceCommand = class
    1212  end;
    1313
     
    125125  end;
    126126
    127   { TSourceFunctionCall }
    128 
    129   TSourceFunctionCall = class(TSourceInstruction)
     127  { TCommandFunctionCall }
     128
     129  TCommandFunctionCall = class(TSourceCommand)
    130130    Name: string;
    131131    Parameters: TSourceReferences;
     
    136136  TSourceCode = class;
    137137
    138   { TSourceBeginEnd }
    139 
    140   TSourceBeginEnd = class(TSourceInstruction)
     138  { TCommandBeginEnd }
     139
     140  TCommandBeginEnd = class(TSourceCommand)
    141141    SourceCode: TSourceCode;
    142142    Instructions: TSourceInstructions;
    143143    constructor Create;
    144144    destructor Destroy; override;
     145  end;
     146
     147  TCommandIfZero = class(TSourceCommand)
     148    Variable: TSourceVariable;
    145149  end;
    146150
     
    155159    Variables: TSourceVariables;
    156160    Constants: TSourceConstants;
    157     Main: TSourceBeginEnd;
     161    Main: TCommandBeginEnd;
    158162    constructor Create;
    159163    destructor Destroy; override;
     
    171175end;
    172176
    173 { TSourceFunctionCall }
    174 
    175 constructor TSourceFunctionCall.Create;
     177{ TCommandFunctionCall }
     178
     179constructor TCommandFunctionCall.Create;
    176180begin
    177181  Parameters := TSourceReferences.Create;
    178182end;
    179183
    180 destructor TSourceFunctionCall.Destroy;
     184destructor TCommandFunctionCall.Destroy;
    181185begin
    182186  Parameters.Free;
     
    184188end;
    185189
    186 { TSourceBeginEnd }
    187 
    188 constructor TSourceBeginEnd.Create;
     190{ TCommandBeginEnd }
     191
     192constructor TCommandBeginEnd.Create;
    189193begin
    190194  Instructions := TSourceInstructions.Create;
    191195end;
    192196
    193 destructor TSourceBeginEnd.Destroy;
     197destructor TCommandBeginEnd.Destroy;
    194198begin
    195199  Instructions.Free;
     
    351355end;
    352356
    353 { TSourceFunctionCall }
     357{ TCommandFunctionCall }
    354358
    355359{ TSourceCode }
     
    394398  Constants := TSourceConstants.Create;
    395399  Functions := TSourceFunctions.Create;
    396   Main := TSourceBeginEnd.Create;
     400  Main := TCommandBeginEnd.Create;
    397401  Main.SourceCode := Self;
    398402  InitFunctions;
Note: See TracChangeset for help on using the changeset viewer.