當前位置: 首頁>>代碼示例>>C#>>正文


C# Ast.NameExpression類代碼示例

本文整理匯總了C#中Microsoft.PythonTools.Parsing.Ast.NameExpression的典型用法代碼示例。如果您正苦於以下問題:C# NameExpression類的具體用法?C# NameExpression怎麽用?C# NameExpression使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


NameExpression類屬於Microsoft.PythonTools.Parsing.Ast命名空間,在下文中一共展示了NameExpression類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ListInsert

        private IAnalysisSet ListInsert(Node node, AnalysisUnit unit, IAnalysisSet[] args, NameExpression[] keywordArgNames) {
            if (args.Length == 2) {
                AppendItem(node, unit, args[1]);
            }

            return unit.ProjectState._noneInst;
        }
開發者ID:omnimark,項目名稱:PTVS,代碼行數:7,代碼來源:ListInfo.cs

示例2: Call

        public override ISet<Namespace> Call(Node node, AnalysisUnit unit, ISet<Namespace>[] args, NameExpression[] keywordArgNames) {
            _generator.Callers.AddDependency(unit);

            _generator.AddReturn(node, unit, base.Call(node, unit, args, keywordArgNames));
            
            return _generator.SelfSet;
        }
開發者ID:wenh123,項目名稱:PTVS,代碼行數:7,代碼來源:GeneratorFunctionInfo.cs

示例3: Call

        public override IAnalysisSet Call(Node node, AnalysisUnit unit, IAnalysisSet[] args, NameExpression[] keywordArgNames) {
            if (_original == null) {
                return base.Call(node, unit, args, keywordArgNames);
            }

            return _original.Call(node, unit, args, keywordArgNames);
        }
開發者ID:jsschultz,項目名稱:PTVS,代碼行數:7,代碼來源:SpecializedNamespace.cs

示例4: FromImportStatement

 public FromImportStatement(ModuleName root, NameExpression/*!*/[] names, NameExpression[] asNames, bool fromFuture, bool forceAbsolute) {
     _root = root;
     _names = names;
     _asNames = asNames;
     _fromFuture = fromFuture;
     _forceAbsolute = forceAbsolute;
 }
開發者ID:wenh123,項目名稱:PTVS,代碼行數:7,代碼來源:FromImportStatement.cs

示例5: Call

        public override IAnalysisSet Call(Node node, AnalysisUnit unit, IAnalysisSet[] args, NameExpression[] keywordArgNames) {
            var res = (DictionaryInfo)unit.Scope.GetOrMakeNodeValue(
                node,
                NodeValueKind.Dictionary,
                (node_) => new DictionaryInfo(unit.ProjectEntry, node)
            );

            if (keywordArgNames.Length > 0) {
                for (int i = 0; i < keywordArgNames.Length; i++) {
                    var curName = keywordArgNames[i].Name;
                    var curArg = args[args.Length - keywordArgNames.Length + i];
                    if (curName == "**") {
                        foreach (var value in curArg) {
                            CopyFrom(args, res);
                        }
                    } else if (curName != "*") {
                        res.AddTypes(
                            node,
                            unit,
                            ProjectState.GetConstant(curName),
                            curArg
                        );
                    }
                }
            } else if (args.Length == 1) {
                foreach (var value in args[0]) {
                    CopyFrom(args, res);
                }
            }
            return res;
        }
開發者ID:jsschultz,項目名稱:PTVS,代碼行數:31,代碼來源:DictBuiltinClassInfo.cs

示例6: Call

        public override IAnalysisSet Call(Node node, AnalysisUnit unit, IAnalysisSet[] args, NameExpression[] keywordArgNames) {
            if (args.Length == 1) {
                var res = unit.Scope.GetOrMakeNodeValue(
                    node,
                    (node_) => MakeFromIndexes(node_, unit.ProjectEntry)
                ) as SequenceInfo;

                List<IAnalysisSet> seqTypes = new List<IAnalysisSet>();
                foreach (var type in args[0]) {
                    SequenceInfo seqInfo = type as SequenceInfo;
                    if (seqInfo != null) {
                        for (int i = 0; i < seqInfo.IndexTypes.Length; i++) {
                            if (seqTypes.Count == i) {
                                seqTypes.Add(seqInfo.IndexTypes[i].Types);
                            } else {
                                seqTypes[i] = seqTypes[i].Union(seqInfo.IndexTypes[i].Types);
                            }
                        }
                    } else {
                        var defaultIndexType = type.GetIndex(node, unit, ProjectState.GetConstant(0));
                        if (seqTypes.Count == 0) {
                            seqTypes.Add(defaultIndexType);
                        } else {
                            seqTypes[0] = seqTypes[0].Union(defaultIndexType);
                        }
                    }
                }

                res.AddTypes(unit, seqTypes.ToArray());

                return res;
            }

            return base.Call(node, unit, args, keywordArgNames);
        }
開發者ID:omnimark,項目名稱:PTVS,代碼行數:35,代碼來源:SequenceBuiltinClassInfo.cs

示例7: Call

 public override IAnalysisSet Call(Node node, AnalysisUnit unit, IAnalysisSet[] args, NameExpression[] keywordArgNames) {
     var res = AnalysisSet.Empty;
     foreach (var member in _members) {
         res = res.Union(member.Call(node, unit, args, keywordArgNames));
     }
     return res;
 }
開發者ID:wenh123,項目名稱:PTVS,代碼行數:7,代碼來源:MultipleMemberInfo.cs

示例8: SequenceIter

 private IAnalysisSet SequenceIter(Node node, AnalysisUnit unit, IAnalysisSet[] args, NameExpression[] keywordArgNames) {
     if (_iterator == null) {
         var types = new [] { new VariableDef() };
         types[0].AddTypes(unit, _indexTypes, false);
         _iterator = new IteratorInfo(types, IteratorInfo.GetIteratorTypeFromType(ClassInfo, unit), node);
     }
     return _iterator ?? AnalysisSet.Empty;
 }
開發者ID:wenh123,項目名稱:PTVS,代碼行數:8,代碼來源:SequenceBuiltinInstanceInfo.cs

示例9: AddParameterReferences

 internal void AddParameterReferences(AnalysisUnit caller, NameExpression[] names) {
     foreach (var name in names) {
         VariableDef param;
         if (name != null && TryGetVariable(name.Name, out param)) {
             param.AddReference(name, caller);
         }
     }
 }
開發者ID:wenh123,項目名稱:PTVS,代碼行數:8,代碼來源:FunctionScope.cs

示例10: ListExtend

        private IAnalysisSet ListExtend(Node node, AnalysisUnit unit, IAnalysisSet[] args, NameExpression[] keywordArgNames) {
            if (args.Length == 1) {
                foreach (var type in args[0]) {
                    AppendItem(node, unit, type.GetEnumeratorTypes(node, unit));
                }
            }

            return unit.ProjectState._noneInst;
        }
開發者ID:omnimark,項目名稱:PTVS,代碼行數:9,代碼來源:ListInfo.cs

示例11: IterableIter

 private IAnalysisSet IterableIter(Node node, AnalysisUnit unit, IAnalysisSet[] args, NameExpression[] keywordArgNames) {
     if (args.Length == 0) {
         return unit.Scope.GetOrMakeNodeValue(
             node,
             NodeValueKind.Iterator,
             n => MakeIteratorInfo(n, unit)
         );
     }
     return AnalysisSet.Empty;
 }
開發者ID:RussBaz,項目名稱:PTVS,代碼行數:10,代碼來源:IterableInfo.cs

示例12: ObjectSetAttr

 private IAnalysisSet ObjectSetAttr(Node node, Analysis.AnalysisUnit unit, IAnalysisSet[] args, NameExpression[] keywordArgNames) {
     if (args.Length >= 3) {
         foreach (var ii in args[0].OfType<InstanceInfo>()) {
             foreach (var key in args[1].GetConstantValueAsString()) {
                 ii.SetMember(node, unit, key, args[2]);
             }
         }
     }
     return AnalysisSet.Empty;
 }
開發者ID:wenh123,項目名稱:PTVS,代碼行數:10,代碼來源:ObjectBuiltinClassInfo.cs

示例13: Call

        public override INamespaceSet Call(Node node, AnalysisUnit unit, INamespaceSet[] args, NameExpression[] keywordArgNames) {
            var realArgs = args;
            if (_inst != null) {
                realArgs = Utils.Concat(_inst.SelfSet, args);
            }

            if (node is CallExpression) {
                return _call((CallExpression)node, unit, realArgs, keywordArgNames) ?? NamespaceSet.Empty;
            }
            return NamespaceSet.Empty;
        }
開發者ID:wenh123,項目名稱:PTVS,代碼行數:11,代碼來源:SpecializedCallableNoAnalyze.cs

示例14: Call

        /// <summary>
        /// Performs a call operation propagating the argument types into any
        /// user defined functions or classes and returns the set of types which
        /// result from the call.
        /// </summary>
        public static IAnalysisSet Call(this IAnalysisSet self, Node node, AnalysisUnit unit, IAnalysisSet[] args, NameExpression[] keywordArgNames) {
            var res = AnalysisSet.Empty;
            foreach (var ns in self) {
                var call = ns.Call(node, unit, args, keywordArgNames);
                Debug.Assert(call != null);

                res = res.Union(call);
            }

            return res;
        }
開發者ID:omnimark,項目名稱:PTVS,代碼行數:16,代碼來源:AnalysisSetExtensions.cs

示例15: Call

        public override IAnalysisSet Call(Node node, AnalysisUnit unit, IAnalysisSet[] args, NameExpression[] keywordArgNames) {
            var newArgs = _args.Take(_args.Length - _keywordArgNames.Length)
                .Concat(args.Take(args.Length - keywordArgNames.Length))
                .Concat(_args.Skip(_args.Length - _keywordArgNames.Length))
                .Concat(args.Skip(args.Length - keywordArgNames.Length))
                .ToArray();

            var newKwArgs = _keywordArgNames.Concat(keywordArgNames).ToArray();

            return _function.Call(node, unit, newArgs, newKwArgs);
        }
開發者ID:jsschultz,項目名稱:PTVS,代碼行數:11,代碼來源:PartialFunctionInfo.cs


注:本文中的Microsoft.PythonTools.Parsing.Ast.NameExpression類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。