|
@@ -75,7 +75,7 @@ type
|
|
Public
|
|
Public
|
|
Constructor Create(AOwner : TComponent); override;
|
|
Constructor Create(AOwner : TComponent); override;
|
|
Destructor Destroy; override;
|
|
Destructor Destroy; override;
|
|
- Procedure Execute;
|
|
|
|
|
|
+ Function Execute: Boolean;
|
|
Procedure GetLastError(Out AError,AErrorClass : String);
|
|
Procedure GetLastError(Out AError,AErrorClass : String);
|
|
// Streams take precedence over filenames. They will be freed on destroy!
|
|
// Streams take precedence over filenames. They will be freed on destroy!
|
|
// OutputStream can be used combined with write callbacks.
|
|
// OutputStream can be used combined with write callbacks.
|
|
@@ -202,19 +202,22 @@ begin
|
|
Include(O,woForwardClasses);
|
|
Include(O,woForwardClasses);
|
|
end;
|
|
end;
|
|
|
|
|
|
-procedure TStubCreator.Execute;
|
|
|
|
-
|
|
|
|
|
|
+function TStubCreator.Execute: Boolean;
|
|
begin
|
|
begin
|
|
FLastErrorClass:='';
|
|
FLastErrorClass:='';
|
|
FLastError:='';
|
|
FLastError:='';
|
|
|
|
+ Result := False;
|
|
|
|
+ if Defines.IndexOf('MakeStub')=-1 then
|
|
|
|
+
|
|
Try
|
|
Try
|
|
DoExecute;
|
|
DoExecute;
|
|
|
|
+
|
|
|
|
+ Result := True;
|
|
except
|
|
except
|
|
On E : Exception do
|
|
On E : Exception do
|
|
begin
|
|
begin
|
|
FLastErrorClass:=E.Classname;
|
|
FLastErrorClass:=E.Classname;
|
|
FLastError:=E.Message;
|
|
FLastError:=E.Message;
|
|
- Raise;
|
|
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
@@ -307,6 +310,8 @@ begin
|
|
SCanner.OnLog:=SE.Onlog;
|
|
SCanner.OnLog:=SE.Onlog;
|
|
For S in FDefines do
|
|
For S in FDefines do
|
|
Scanner.AddDefine(S);
|
|
Scanner.AddDefine(S);
|
|
|
|
+ if FDefines.IndexOf('MAKESTUB')=-1 then
|
|
|
|
+ Scanner.AddDefine('MAKESTUB');
|
|
Scanner.OpenFile(InputFilename);
|
|
Scanner.OpenFile(InputFilename);
|
|
// Parser
|
|
// Parser
|
|
Parser:=TPasParser.Create(Scanner, FileResolver, SE);
|
|
Parser:=TPasParser.Create(Scanner, FileResolver, SE);
|
|
@@ -340,7 +345,7 @@ begin
|
|
FLineNumberWidth:=4;
|
|
FLineNumberWidth:=4;
|
|
FIndentSize:=2;
|
|
FIndentSize:=2;
|
|
FExtraUnits:='';
|
|
FExtraUnits:='';
|
|
- FOptions:=[woNoImplementation,woNoExternalClass,woNoExternalVar,woNoExternalFunc,woNoAsm,woSkipPrivateExternals,woAlwaysRecordHelper];
|
|
|
|
|
|
+ FOptions:=[woNoImplementation,woNoExternalClass,woNoExternalVar,woNoExternalFunc,woNoAsm,woSkipPrivateExternals,woAlwaysRecordHelper,woSkipHints];
|
|
end;
|
|
end;
|
|
|
|
|
|
destructor TStubCreator.Destroy;
|
|
destructor TStubCreator.Destroy;
|