home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2000 February
/
Chip_2000-02_cd.bin
/
zkuste
/
Delphi
/
navody
/
tt
/
objvm.exe
/
SAMPLE
/
uObjLang.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1998-03-10
|
1KB
|
53 lines
unit uObjLang;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Compiler,Code,ObjCodeGeneration;
type
TObjLang = class(TDataModule)
Compiler: TCompiler;
procedure CompilerOnR77(Sender: TCompiler; Bush: TBush);
private
{ Private declarations }
g:TObjCodeGeneration;
public
{ Public declarations }
function CompileTo(s:TStrings;c:TCode):boolean;
end;
var
ObjLang: TObjLang;
implementation
{$R *.DFM}
function TObjLang.CompileTo;
begin
g:=TObjCodeGeneration.Create(c);
try
Compiler.BeginCompile;
Compiler.AcceptStrings(0,s);
except
Compiler.EndCompile;
g.Free;
raise;
end;
try
Compiler.EndCompile;
except
g.Free;
raise;
end;
g.Free;
Result:=not Compiler.WasErrors;
end;
procedure TObjLang.CompilerOnR77(Sender: TCompiler; Bush: TBush);
begin
g.cBool(false);
end;
end.