Ignore:
Timestamp:
Oct 22, 2010, 9:22:55 AM (14 years ago)
Author:
george
Message:
  • Compiler producer for C language separated to GCC and Dynamic C dialect.
  • Enhanced: Parse record functions body.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Transpascal/Compiler/UCompiler.pas

    r76 r77  
    88  SysUtils, Variants, Classes,
    99  Dialogs, USourceCode, UProducer, UPascalParser, UParser,
    10   UProducerC, Contnrs;
     10  UProducerDynamicC, Contnrs, UProducerTreeView, UProducerASM8051,
     11  UProducerPascal, UProducerGCCC;
    1112
    1213type
     14  TProducerType = (ptGCCC, ptDynamicC, ptPascal, ptAssembler, ptXML);
    1315
    1416  TErrorMessage = class
     
    3335  private
    3436    FOnErrorMessage: TErrorMessageEvent;
     37    FProducerType: TProducerType;
    3538    procedure ErrorMessage(Text: string; Position: TPoint; FileName: string);
     39    procedure SetProducerType(const AValue: TProducerType);
    3640  public
    3741    ProgramCode: TProgram;
     
    4953    property OnErrorMessage: TErrorMessageEvent read FOnErrorMessage
    5054      write FOnErrorMessage;
     55    property ProducerType: TProducerType read FProducerType
     56      write SetProducerType;
    5157  end;
     58
     59const
     60  ProducerTypeName: array[TProducerType] of string = (
     61    'GCC C', 'Rabbit Dynamic C', 'Generic Pascal', 'Assembler', 'XML');
     62
    5263
    5364implementation
     
    93104
    94105  ProgramCode := TProgram.Create;
    95   Producer := TProducerC.Create;
     106  Producer := TProducerGCCC.Create;
    96107  Parser := TPascalParser.Create;
    97108  Parser.OnErrorMessage := ErrorMessage;
     
    127138end;
    128139
     140procedure TCompiler.SetProducerType(const AValue: TProducerType);
     141begin
     142  if FProducerType = AValue then Exit;
     143  FProducerType := AValue;
     144  Producer.Free;
     145  case AValue of
     146    ptGCCC: Producer := TProducerGCCC.Create;
     147    ptDynamicC: Producer := TProducerDynamicC.Create;
     148    ptPascal: Producer := TProducerPascal.Create;
     149    ptAssembler: Producer := TProducerGCCC.Create;
     150    ptXML: Producer := TProducerTreeView.Create;
     151  end;
     152end;
     153
    129154{ TCompilerTargetList }
    130155
Note: See TracChangeset for help on using the changeset viewer.