Example #1
0
 public void Add(SymbolId name, object value)
 {
     throw new NotImplementedException();
 }
Example #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));
 }
Example #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))));
 }
Example #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));
        }
Example #5
0
 /// <summary>
 /// Attemps to remove the provided name from this scope
 /// </summary>
 public bool TryRemoveName(SymbolId name)
 {
     return(TryRemoveName(InvariantContext.Instance, name));
 }
Example #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));
 }
Example #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);
 }
Example #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);
 }
Example #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);
 }
Example #12
0
 public bool Remove(SymbolId key)
 {
     lock (this) return(_data.Remove(key));
 }
Example #13
0
 public bool ContainsKey(SymbolId key)
 {
     lock (this) return(_data.ContainsKey(key));
 }
Example #14
0
 public void Add(SymbolId key, object value)
 {
     lock (this) _data.Add(key, value);
 }
Example #15
0
 public bool Remove(SymbolId name)
 {
     throw new NotImplementedException();
 }
Example #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;
 }
Example #17
0
 public bool ContainsKey(SymbolId name)
 {
     throw new NotImplementedException();
 }
Example #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));
 }
Example #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));
 }
Example #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);
 }
Example #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));
 }
Example #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);
 }
Example #23
0
 /// <summary>
 /// Removes the provided name from this scope
 /// </summary>
 public void RemoveName(SymbolId name)
 {
     RemoveName(InvariantContext.Instance, name);
 }
Example #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);
 }
Example #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);
 }
Example #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);
        }
Example #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));
 }
Example #28
0
 protected internal abstract bool TryGetExtraValue(SymbolId key, out object value);