예제 #1
0
 public void Add(SymbolId name, object value)
 {
     throw new NotImplementedException();
 }
예제 #2
0
 /// <summary>
 /// Attempts to remove the name from the provided scope using the current language's semantics.
 /// </summary>
 public virtual bool RemoveName(CodeContext context, SymbolId name)
 {
     return(context.Scope.RemoveName(this, name));
 }
예제 #3
0
 /// <summary>
 /// Called when a lookup has failed and an exception should be thrown.  Enables the
 /// language context to throw the appropriate exception for their language when
 /// name lookup fails.
 /// </summary>
 protected internal virtual Exception MissingName(SymbolId name)
 {
     return(new MissingMemberException(String.Format(CultureInfo.CurrentCulture, Resources.NameNotDefined, SymbolTable.IdToString(name))));
 }
예제 #4
0
        /// <summary>
        /// Determines if this context or any outer scope contains the defined name that
        /// is available from the provided LanguageContext.
        /// </summary>
        public bool ContainsName(LanguageContext context, SymbolId name)
        {
            object tmp;

            return(TryLookupName(context, name, out tmp));
        }
예제 #5
0
 /// <summary>
 /// Attemps to remove the provided name from this scope
 /// </summary>
 public bool TryRemoveName(SymbolId name)
 {
     return(TryRemoveName(InvariantContext.Instance, name));
 }
예제 #6
0
 /// <summary>
 /// Attempts to lookup the provided name in this scope or any outer scope.
 /// </summary>
 public bool TryLookupName(SymbolId name, out object value)
 {
     return(TryLookupName(InvariantContext.Instance, name, out value));
 }
예제 #7
0
        /// <summary>
        /// Sets the name to the specified value for the current context.
        /// </summary>
        /// <exception cref="MemberAccessException">The name has already been published and marked as ReadOnly</exception>
        public void SetName(SymbolId name, object value)
        {
            //if (_attrs != null) _attrs.CheckWritable(name);

            _dict[name] = value;
        }
 protected internal override bool TryGetExtraValue(SymbolId key, out object value)
 {
     value = null;
     return(false);
 }
예제 #9
0
 /// <summary>
 /// Trys to lookup the provided name in the current scope's context specific dictionary.
 /// Search includes names that are only visible to the provided LanguageContext.
 /// </summary>
 public bool TryGetNameForContext(LanguageContext context, SymbolId name, out object value)
 {
     value = null;
     return(false);
 }
예제 #10
0
 public bool TryGetValue(SymbolId key, out object value)
 {
     lock (this) return(_data.TryGetValue(key, out value));
 }
 protected internal override bool TrySetExtraValue(SymbolId key, object value)
 {
     return(false);
 }
예제 #12
0
 public bool Remove(SymbolId key)
 {
     lock (this) return(_data.Remove(key));
 }
예제 #13
0
 public bool ContainsKey(SymbolId key)
 {
     lock (this) return(_data.ContainsKey(key));
 }
예제 #14
0
 public void Add(SymbolId key, object value)
 {
     lock (this) _data.Add(key, value);
 }
예제 #15
0
 public bool Remove(SymbolId name)
 {
     throw new NotImplementedException();
 }
예제 #16
0
 /// <summary>
 /// Sets the name to the specified value for the current context.
 ///
 /// Provides the ScopeMemberAttributes which should be set on the provided object.
 /// </summary>
 /// <exception cref="MemberAccessException">The name has already been published and marked as ReadOnly</exception>
 public void SetName(SymbolId name, object value, ScopeMemberAttributes attributes)
 {
     _dict[name] = value;
 }
예제 #17
0
 public bool ContainsKey(SymbolId name)
 {
     throw new NotImplementedException();
 }
예제 #18
0
 /// <summary>
 /// Called from generated code, helper to do name lookup
 /// </summary>
 public static object LookupName(CodeContext context, SymbolId name)
 {
     return(context.Scope.LookupName(context.LanguageContext, name));
 }
예제 #19
0
 /// <summary>
 /// Attempts to lookup the provided name in this scope or any outer scope.   If the
 /// name is not defined MissingMemberException is thrown.
 /// </summary>
 public object LookupName(SymbolId name)
 {
     return(LookupName(InvariantContext.Instance, name));
 }
예제 #20
0
 /// <summary>
 /// Called from generated code, helper to do name assignment.
 /// Order of parameters matches the codegen flow.
 /// </summary>
 public static object SetNameReorder(object value, CodeContext context, SymbolId name)
 {
     context.LanguageContext.SetName(context, name, value);
     return(value);
 }
예제 #21
0
 /// <summary>
 /// Determines if this context or any outer scope contains the defined name.
 /// </summary>
 public bool ContainsName(SymbolId name)
 {
     return(ContainsName(InvariantContext.Instance, name));
 }
예제 #22
0
 /// <summary>
 /// Called from generated code, helper to do name assignment
 /// </summary>
 public static void SetName(CodeContext context, SymbolId name, object value)
 {
     context.LanguageContext.SetName(context, name, value);
 }
예제 #23
0
 /// <summary>
 /// Removes the provided name from this scope
 /// </summary>
 public void RemoveName(SymbolId name)
 {
     RemoveName(InvariantContext.Instance, name);
 }
예제 #24
0
 /// <summary>
 /// Called from generated code, helper to remove a name
 /// </summary>
 public static object RemoveName(CodeContext context, SymbolId name)
 {
     context.LanguageContext.RemoveName(context, name);
     return(null);
 }
예제 #25
0
 /// <summary>
 /// Attempts to set the name in the provided scope using the current language's semantics.
 /// </summary>
 public virtual void SetName(CodeContext context, SymbolId name, object value)
 {
     context.Scope.SetName(name, value);
 }
예제 #26
0
        public static void InitializeModuleField(CodeContext context, SymbolId name, ref ModuleGlobalWrapper wrapper)
        {
            ModuleGlobalCache mgc = context.LanguageContext.GetModuleCache(name);

            wrapper = new ModuleGlobalWrapper(context, mgc, name);
        }
예제 #27
0
 /// <summary>
 /// Attemps to lookup a global variable using the language's semantics called from
 /// the provided Scope.  The default implementation will attempt to lookup the variable
 /// at the host level.
 /// </summary>
 public virtual bool TryLookupGlobal(CodeContext context, SymbolId name, out object value)
 {
     return(ScriptDomainManager.CurrentManager.Host.TryGetVariable(Engine, name, out value));
 }
예제 #28
0
 protected internal abstract bool TryGetExtraValue(SymbolId key, out object value);