Ignore:
Timestamp:
Nov 5, 2010, 11:31:04 AM (14 years ago)
Author:
george
Message:
  • Added: Typecasting support.
  • Fixed: Function call in expressions.
  • Added: Producer module specify generated file name, extension and placing.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Compiler/UCompiler.pas

    r2 r6  
    7373  ProducedCode: TStringList;
    7474  I: Integer;
     75  TargetFileName: string;
    7576begin
    7677  try
     
    8182    //ShowMessage(IntToHex(Integer(Addr(Parser.OnGetSource)), 8));
    8283    Parser.ParseModule(ProgramCode);
    83     for I := 0 to ProgramCode.Modules.Count - 1 do begin
    84       Producer.Produce(TModule(ProgramCode.Modules[I]));
     84    with ProgramCode do
     85    for I := 0 to Modules.Count - 1 do begin
     86      Producer.Produce(TModule(Modules[I]));
    8587      Producer.AssignToStringList(ProducedCode);
    86       ForceDirectories(TargetFolder + DirectorySeparator +
    87         CompiledFolder + DirectorySeparator + Producer.ClassName);
    88       ProducedCode.SaveToFile(TargetFolder + DirectorySeparator +
     88      TargetFileName := TargetFolder + DirectorySeparator +
    8989        CompiledFolder + DirectorySeparator + Producer.ClassName +
    90         DirectorySeparator + TModule(ProgramCode.Modules[I]).Name + Producer.FileExtension);
     90        DirectorySeparator + TModule(Modules[I]).TargetFile;
     91      ForceDirectories(ExtractFileDir(TargetFileName));
     92      ProducedCode.SaveToFile(TargetFileName);
    9193    end;
    9294  finally
Note: See TracChangeset for help on using the changeset viewer.