using System; namespace ScriptNET.Runtime { /// /// Base interface for Script Context obect. /// ScriptContext object stores run-time information during script's execution /// This information containts: /// Scopes - which stores variables, types and functions /// Execution Flow Flags - break, return, continue /// /// ScriptContext objects also evaluates operators /// public interface IScriptContext //: IEvaluationContext { #region Scopes /// /// Create scope /// void CreateScope(); /// /// Add given scope to hierarchy /// /// new scope void CreateScope(IScriptScope scope); /// /// Removes local scope /// void RemoveLocalScope(); /// /// Current scope /// IScriptScope Scope { get; } /// /// Returns item from scope hierarchy /// /// name /// type /// value object GetItem(string id, bool throwException); /// /// Sets item to scope hierarchy /// /// name /// type /// value void SetItem(string id, object value); /// /// Finds function definition /// /// name /// function object IInvokable GetFunctionDefinition(string name); #endregion #region Break-Continue-Return void SetReturn(bool val); void SetBreak(bool val); void SetContinue(bool val); bool IsReturn(); bool IsBreak(); bool IsContinue(); #endregion /// /// Source code /// string SourceCode { get; } /// /// Result of script execution /// object Result { get; set; } } }