Ignore:
Timestamp:
Apr 9, 2009, 2:08:56 PM (16 years ago)
Author:
george
Message:
  • Přidáno: Nástřel parsování funkcí.
  • Přidáno: Zobrazení stromu struktury programu.
  • Opraveno: Zobrazení chybových hlášení.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DelphiToC/UPascalSource.pas

    r14 r19  
    1717  TNodeType = (ntNone, ntVariable, ntFunction, ntConstant, ntOperator);
    1818
    19   TValue = array of Byte;
     19  TValue = Variant; //array of Byte;
    2020
    2121  TCommonBlock = class;
     
    2828  TOperationList = class;
    2929  TFunction = class;
     30  TVariable = class;
     31  TConstant = class;
    3032
    3133  TDevice = class
    3234    Family: string;
    3335    Memory: array[TMemoryType] of Integer;
     36  end;
     37
     38  TContext = class
     39
     40  end;
     41
     42  TCommandList = class;
     43
     44  TCommand = class
     45
     46  end;
     47
     48  TBeginEnd = class(TCommand)
     49    Commands: TCommandList;
     50  end;
     51
     52  TWhileDo = class(TCommand)
     53    Condition: TExpression;
     54    Command: TCommand;
     55  end;
     56
     57  WithDo = class(TCommand)
     58    Context: TContext;
     59    Command: TCommand;
     60  end;
     61
     62  RepeatUntil = class(TCommand)
     63    Block: TCommandList;
     64    Condition: TExpression;
     65  end;
     66
     67  ForToDo = class(TCommand)
     68    ControlVariable: TVariable;
     69    Start: TExpression;
     70    Stop: TExpression;
     71    Command: TCommand;
     72  end;
     73
     74  IfThenElse = class(TCommand)
     75    Condition: TExpression;
     76    Command: TCommand;
     77    ElseCommand: TCommand;
     78  end;
     79
     80  TCaseOfEndBranche = class
     81    Constant: TConstant;
     82    Command: TCommand;
     83  end;
     84
     85  CaseOfEnd = class(TCommand)
     86    Expression: TExpression;
     87    Branches: TList; // TList<TCaseOfEndBranche>
     88    ElseCommand: TCommand;
     89  end;
     90
     91  TryFinally = class(TCommand)
     92    Block: TCommandList;
     93    FinallyBlock: TCommandList;
     94  end;
     95
     96  TryExcept = class(TCommand)
     97    Block: TCommandList;
     98    ExceptBlock: TCommandList;
     99  end;
     100
     101
     102
     103  TCommandList = class(TList)
     104
    34105  end;
    35106
     
    54125  end;
    55126
     127  TTypeRecordItem = class
     128    Name: string;
     129    DataType: TType;
     130  end;
     131
     132  TTypeRecord = class
     133    Items: TList; // TList<TTypeRecordItem>
     134  end;
     135
     136  TTypeArray = class
     137    //Range: TTypeRange;
     138    ItemType: TType;
     139  end;
     140
    56141  TTypeList = class(TList)
    57142    Parent: TCommonBlock;
     
    100185  end;
    101186
    102 
    103187  TOperation = class
    104188    Instruction: TInstruction;
     
    125209    Parent: TCommonBlock;
    126210    function Search(Name: string): TFunction;
     211    destructor Destroy; override;
    127212  end;
    128213
     
    331416{ TFunctionList }
    332417
     418destructor TFunctionList.Destroy;
     419var
     420  I: Integer;
     421begin
     422  for I := 0 to Count - 1 do
     423    TFunction(Items[I]).Free;
     424  inherited;
     425end;
     426
    333427function TFunctionList.Search(Name: string): TFunction;
    334428var
Note: See TracChangeset for help on using the changeset viewer.