// (C) 2003, Cesar Lopez Nataren
//
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
using System;
using System.Reflection;
using System.Security.Policy;
using System.Threading;
+using Microsoft.JScript;
+using Microsoft.JScript.Vsa;
namespace Microsoft.Vsa {
private bool siteAlreadySet;
private bool running;
- // indicates that RootMoniker and Site have been set.
- private bool initialized;
-
private bool namespaceNotSet;
private bool supportDebug;
private bool generateDebugInfo;
- private bool compiled;
+ protected bool compiled;
private bool dirty;
private bool initNewCalled;
private string name;
private string rootNamespace;
+ // FIXME: must set vars to proper values
+ internal BaseVsaEngine ()
+ {}
+
public BaseVsaEngine (string language, string version, bool supportDebug)
{
this.language = language;
this.rootNamespace = "";
this.namespaceNotSet = true;
- this.initialized = false;
this.initNewCalled = false;
this.generateDebugInfo = false;
this.closed = false;
else if (!initNewCalled)
throw new VsaException (VsaError.EngineNotInitialized);
+ items = new VsaItems ((VsaEngine) this);
return items;
}
}
public virtual void Close ()
{
+ if (running)
+ Reset ();
+ else if (closed)
+ throw new VsaException (VsaError.EngineClosed);
+ else if (busy)
+ throw new VsaException (VsaError.EngineBusy);
+
running = false;
+ closed = true;
}
+
+ //
+ // Count that AssemblyExpected exception may be thrown.
+ //
public virtual bool Compile ()
{
if (closed)
public virtual object GetOption (string name)
{
- throw new NotImplementedException ();
+ object opt;
+
+ try {
+ opt = GetSpecificOption (name);
+ } catch (VsaException e) {
+ throw;
+ }
+ return opt;
}
+ protected abstract object GetSpecificOption (string name);
+
+ protected abstract void SetSpecificOption (string name, object val);
+
public virtual void InitNew ()
{
if (closed)
}
public abstract bool IsValidIdentifier (string ident);
+
+ internal bool Closed {
+ get { return closed; }
+ }
+
+ internal bool Running {
+ get { return running; }
+ }
+
+ internal bool Busy {
+ get { return busy; }
+ }
+
+ internal bool InitNewCalled {
+ get { return initNewCalled; }
+ set { initNewCalled = value; }
+ }
}
public class BaseVsaSite : IVsaSite {