当前位置: 首页>>代码示例>>C#>>正文


C# SymbolId.GetString方法代码示例

本文整理汇总了C#中SymbolId.GetString方法的典型用法代码示例。如果您正苦于以下问题:C# SymbolId.GetString方法的具体用法?C# SymbolId.GetString怎么用?C# SymbolId.GetString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SymbolId的用法示例。


在下文中一共展示了SymbolId.GetString方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BindInParent

 internal bool BindInParent(SymbolId name, Binder binder)
 {
     Binding binding;
     ContainsNestedFreeVariables = true;
     if (TryGetBinding(name, out binding)) {
         if (binding.IsGlobal) {
             return false;
         } else {
             if (binding.IsDeleted) {
                 binder.ReportSyntaxError(string.Format("can not delete variable '{0}' referenced in nested scope", name.GetString()), this);
             }
             MakeEnvironment(name);
             HasEnvironment = true;
             return true;
         }
     }
     if (parent != null) {
         if (parent.BindInParent(name, binder)) {
             IsClosure = true;
             HasEnvironment = true;
             return true;
         }
     }
     return false;
 }
开发者ID:FabioNascimento,项目名称:DICommander,代码行数:25,代码来源:ScopeStatement.cs

示例2: InferMethods

        public override IList<FunctionInfo> InferMethods(SymbolId name)
        {
            Initialize();

            List<ReflectedMember> list;
            IList<FunctionInfo> result = null;
            if (members.TryGetValue(name, out list)) {
                foreach (ReflectedMember member in list) {
                    ReflectedMethod method = member as ReflectedMethod;
                    if (null != method) {
                        result = Engine.Union<FunctionInfo>(result, method.InferMethods(name));
                    }
                }
            } else if (type.Name == name.GetString()) {
                members.TryGetValue(SymbolTable.StringToId(".ctor"), out list);
                foreach (ReflectedMember member in list) {
                    ReflectedConstructor constructor = member as ReflectedConstructor;
                    if (constructor != null) {
                        result = Engine.Union<FunctionInfo>(result, constructor.InferMethods(name));
                    }
                }
            }

            return result;
        }
开发者ID:ufosky-server,项目名称:MultiversePlatform,代码行数:25,代码来源:Inferred.cs

示例3: MakeSlot

 public override Slot MakeSlot(SymbolId name, Type type)
 {
     FieldBuilder fb = typeGen.myType.DefineField(name.GetString(), type, FieldAttributes.Public);
     return new FieldSlot(instance, fb);
 }
开发者ID:FabioNascimento,项目名称:DICommander,代码行数:5,代码来源:SlotFactory.cs

示例4:

 public Slot this[SymbolId name]
 {
     get {
         Debug.Assert(slots.ContainsKey(name), "undefined slot: " + name.GetString());
         return slots[name];
     }
     set {
         Debug.Assert(!slots.ContainsKey(name), "slot override: " + name.GetString());
         slots[name] = value;
     }
 }
开发者ID:FabioNascimento,项目名称:DICommander,代码行数:11,代码来源:Namespace.cs

示例5: GetPropertyHelper

 public static object GetPropertyHelper(object prop, object instance, SymbolId name)
 {
     IDescriptor desc = prop as IDescriptor;
     if (desc == null) {
         throw Ops.TypeError("Expected property for {0}, but found {1}",
             name.GetString(), Ops.GetDynamicType(prop).__name__);
     }
     return desc.GetAttribute(instance, null);
 }
开发者ID:FabioNascimento,项目名称:DICommander,代码行数:9,代码来源:UserType.cs

示例6: SetPropertyHelper

 public static void SetPropertyHelper(object prop, object instance, object newValue, SymbolId name)
 {
     IDataDescriptor desc = prop as IDataDescriptor;
     if (desc == null) {
         throw Ops.TypeError("Expected settable property for {0}, but found {1}",
             name.GetString(), Ops.GetDynamicType(prop).__name__);
     }
     desc.SetAttribute(instance, newValue);
 }
开发者ID:FabioNascimento,项目名称:DICommander,代码行数:9,代码来源:UserType.cs

示例7: AddRemoveEventHelper

        public static void AddRemoveEventHelper(object method, object instance, UserType context, object eventValue, SymbolId name)
        {
            object callable = Ops.GetDescriptor(method, instance, context);
            if (!Ops.IsCallable(callable)) {
                throw Ops.TypeError("Expected callable value for {0}, but found {1}", name.GetString(),
                    Ops.GetDynamicType(method).Name);
            }

            Ops.Call(callable, eventValue);
        }
开发者ID:FabioNascimento,项目名称:DICommander,代码行数:10,代码来源:UserType.cs

示例8: FixName

        private SymbolId FixName(SymbolId name)
        {
            if (privatePrefix != null && IsPrivateName(name)) {
                name = SymbolTable.StringToId(string.Format("_{0}{1}", privatePrefix, name.GetString()));
            }

            return name;
        }
开发者ID:FabioNascimento,项目名称:DICommander,代码行数:8,代码来源:Parser.cs

示例9: CheckUniqueParameter

 private void CheckUniqueParameter(Dictionary<SymbolId, SymbolId> names, SymbolId name)
 {
     if (names.ContainsKey(name)) {
         ReportSyntaxError(string.Format("duplicate argument '{0}' in function definition", name.GetString()));
     }
     names[name] = name;
 }
开发者ID:FabioNascimento,项目名称:DICommander,代码行数:7,代码来源:Parser.cs

示例10: IsPrivateName

 private static bool IsPrivateName(SymbolId name)
 {
     string s = name.GetString();
     return s.StartsWith("__") && !s.EndsWith("__");
 }
开发者ID:FabioNascimento,项目名称:DICommander,代码行数:5,代码来源:Parser.cs

示例11: SetPrivatePrefix

        public string SetPrivatePrefix(SymbolId name)
        {
            // Remove any leading underscores before saving the prefix
            string oldPrefix = privatePrefix;

            if (name != SymbolTable.Empty) {
                string prefixString = name.GetString();
                for (int i = 0; i < prefixString.Length; i++) {
                    if (prefixString[i] != '_') {
                        privatePrefix = prefixString.Substring(i);
                        return oldPrefix;
                    }
                }
            }
            // Name consists of '_'s only, no private prefix mapping
            privatePrefix = null;
            return oldPrefix;
        }
开发者ID:FabioNascimento,项目名称:DICommander,代码行数:18,代码来源:Parser.cs


注:本文中的SymbolId.GetString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。