home *** CD-ROM | disk | FTP | other *** search
- unit uObjVM;
-
- interface
- uses Classes,
- Code,uExecution,LangValue,RootValue,OpList;
- type IObjVM=class(IValueOwner)
- public
- Ops:TOpList;
- Root:TRootValue;
- {Current execution if run method used}
- Execution:IExecution;
- {Contructor}
- constructor Create(o:TComponent);override;
- {}
- function StartExecution(c:TCode):IExecution;virtual;abstract;
- {Run code}
- procedure Run(c:TCode);virtual;
- {Halt the current execution}
- procedure Halt;virtual;
- end;
- implementation
- constructor IObjVM.Create;
- begin
- inherited;
- Execution:=nil;
- end;
-
- procedure IObjVM.Run;
- begin
- Execution:=StartExecution(c);
- try
- Execution.Run;
- finally
- Execution.Free;
- Execution:=nil;
- end;
- end;
- procedure IObjVM.Halt;
- begin
- Execution.Halt;
- end;
-
- end.
-