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


C# SymbolId类代码示例

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


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

示例1: Define

 public void Define(SymbolId name, Definition definition)
 {
     if (name != SymbolTable.Empty)
     {
         current.Define(name, definition);
     }
 }
开发者ID:smartmobili,项目名称:parsing,代码行数:7,代码来源:Analyzer.cs

示例2: Contains

        public override bool Contains(SymbolId key) {
            if (_data == null) return false;

            lock (this) {
                return _data.ContainsKey(key);
            }
        }
开发者ID:jxnmaomao,项目名称:ironruby,代码行数:7,代码来源:SymbolIdDictionaryStorage.cs

示例3: TryGetPackageAny

 public MemberTracker TryGetPackageAny(SymbolId name) {
     MemberTracker ret;
     if (TryGetValue(name, out ret)) {
         return ret;
     }
     return null;
 }
开发者ID:Hank923,项目名称:ironruby,代码行数:7,代码来源:TopNamespaceTracker.cs

示例4: PythonTypeChangedEventArgs

 public PythonTypeChangedEventArgs(CodeContext context, SymbolId changed, ChangeType type, object previous, object newValue) {
     _context = context;
     _changed = changed;
     _type = type;
     _previous = previous;
     _newValue = newValue;
 }
开发者ID:JamesTryand,项目名称:IronScheme,代码行数:7,代码来源:PythonTypeChangedEventArgs.cs

示例5: TryGetPackage

 public NamespaceTracker TryGetPackage(SymbolId name) {
     NamespaceTracker pm = TryGetPackageAny(name) as NamespaceTracker;
     if (pm != null) {
         return pm;
     }
     return null;
 }
开发者ID:Hank923,项目名称:ironruby,代码行数:7,代码来源:TopNamespaceTracker.cs

示例6: TryGetExtraValue

        protected override bool TryGetExtraValue(SymbolId key, out object value)
        {
            var property = _viewType.GetProperty(key.ToString());
            if (property != null)
            {
                value = property.GetValue(_view, null);
                return true;
            }

            var field = _viewType.GetField(key.ToString());
            if (field != null)
            {
                value = field.GetValue(_view);
                return true;
            }

            var method = _viewType.GetMethod(key.ToString());
            if (method != null)
            {
                var parameterTypes = method.GetParameters().Select(p => p.ParameterType).ToList();
                parameterTypes.Add(method.ReturnType);
                value = Delegate.CreateDelegate(
                    CompilerHelpers.MakeCallSiteDelegateType(parameterTypes.ToArray()),
                    _view,
                    key.ToString());
                return true;
            }

            if (_view.TryGetViewData(key.ToString(), out value))
                return true;

            value = null;
            return false;
        }
开发者ID:ronniebarker,项目名称:spark,代码行数:34,代码来源:ScriptingViewSymbolDictionary.cs

示例7: PythonVariable

 public PythonVariable(SymbolId name, Type/*!*/ type, VariableKind kind, ScopeStatement/*!*/ scope) {
     Assert.NotNull(type, scope);
     _name = name;
     _type = type;
     _kind = kind;
     _scope = scope;
 }
开发者ID:octavioh,项目名称:ironruby,代码行数:7,代码来源:PythonVariable.cs

示例8: Add

        public override void Add(SymbolId key, object value) {
            lock (this) {
                EnsureData();

                _data[key] = value;
            }
        }
开发者ID:jxnmaomao,项目名称:ironruby,代码行数:7,代码来源:SymbolIdDictionaryStorage.cs

示例9: FromImportStatement

 public FromImportStatement(ModuleName root, SymbolId[] names, SymbolId[] asNames, bool fromFuture, bool forceAbsolute) {
     _root = root;
     _names = names;
     _asNames = asNames;
     _fromFuture = fromFuture;
     _forceAbsolute = forceAbsolute;
 }
开发者ID:octavioh,项目名称:ironruby,代码行数:7,代码来源:FromImportStatement.cs

示例10: CreateSlot

        protected override Slot CreateSlot(SymbolId name, Type type)
        {
            FieldBuilder fb = _typeGen.TypeBuilder.DefineField(SymbolTable.IdToString( name),
              type, FieldAttributes.Assembly | FieldAttributes.Static);

            return new StaticFieldSlot(fb);
        }
开发者ID:robertlj,项目名称:IronScheme,代码行数:7,代码来源:StaticFieldSlotFactory.cs

示例11: Method

        public static object Method(object[] args)
        {
            Debug.Assert(args.Length >= 3, "A call to «method» should have at least two parameters: the name of the method and its block");
            Debug.Assert(args[0] is DictionaryBonsaiFunction);
            for (int i = 1; i < args.Length - 1; i++)
                Debug.Assert(args[i] is SymbolId, "Argument " + i + " should be a SymbolId");
            Debug.Assert(args[args.Length - 1] is BlockBonsaiFunction, "The last arguments should be a block");

            var scope = (DictionaryBonsaiFunction)args[0];
            var name = (SymbolId)args[1];
            var block = (BlockBonsaiFunction)args[args.Length - 1];
            var self = (BonsaiPrototypeFunction)scope["self"];

            var parameters = new SymbolId[args.Length - 3];
            for (int i = 2; i < args.Length - 1; i++)
                parameters[i - 2] = (SymbolId)args[i];

            self[name] = new DelegateBonsaiFunction(callArgs => {
                Debug.Assert(callArgs.Length - 1 == parameters.Length, "The number of arguments should equal the number of parameters");

                var blockLocalVariables = new DictionaryBonsaiFunction();
                for (int i = 0; i < parameters.Length; i++) {
                    blockLocalVariables[parameters[i]] = callArgs[i + 1];
                }
                var callSelf = ((DictionaryBonsaiFunction)callArgs[0])["self"];
                blockLocalVariables["self"] = callSelf;
                return block.Invoke(blockLocalVariables);
            });

            return self[name];
        }
开发者ID:eugen,项目名称:Bonsai,代码行数:31,代码来源:BonsaiPrototypeFunction.cs

示例12: BonsaiPrototypeFunction

        public BonsaiPrototypeFunction(SymbolId? name = null, BonsaiPrototypeFunction prototype = null)
            : base(null)
        {
            if (name.HasValue)
                this.Name = name.Value;
            else
                this.Name = "«unnamed»".ToSymbol();

            if (prototype == null) {
                foreach (MethodInfo method in this.GetType().GetMethods(
                    BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static   )) {
                    var attrs = method.GetCustomAttributes(typeof(MapsToSymbolAttribute), false);
                    foreach (MapsToSymbolAttribute mapper in attrs) {
                        this.Dict.Add(
                            mapper.Symbol,
                            new DelegateBonsaiFunction((Func<object[], object>)Delegate.CreateDelegate(
                                typeof(Func<object[], object>),
                                method.IsStatic ? null : this,
                                method)));
                    }
                }
            } else {
                this.Dict = new SortedList<SymbolId, object>(prototype.Dict);
            }
        }
开发者ID:eugen,项目名称:Bonsai,代码行数:25,代码来源:BonsaiPrototypeFunction.cs

示例13: ComparisonPattern

 public ComparisonPattern(SymbolId symbol, object testedValue)
 {
     if (!(testedValue is IComparable))
         throw new ArgumentException("testedValue must be IComparable", "testedValue");
     this.ParameterName = symbol;
     this.TestedValue = testedValue;
 }
开发者ID:eugen,项目名称:Bonsai,代码行数:7,代码来源:Patterns.cs

示例14: TryGetPackageLazy

 public MemberTracker TryGetPackageLazy(SymbolId name) {
     MemberTracker ret;
     if (_dict.TryGetValue(SymbolTable.IdToString(name), out ret)) {
         return ret;
     }
     return null;
 }
开发者ID:JamesTryand,项目名称:IronScheme,代码行数:7,代码来源:TopNamespaceTracker.cs

示例15: PythonGlobal

        public PythonGlobal(CodeContext/*!*/ context, SymbolId name) {
            Assert.NotNull(context);

            _value = Uninitialized.Instance;
            _context = context;
            _name = name;
        }
开发者ID:joshholmes,项目名称:ironruby,代码行数:7,代码来源:PythonGlobal.cs


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