home *** CD-ROM | disk | FTP | other *** search
- 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.
-