• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Ast.NameExpression类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



NameExpression类属于Microsoft.PythonTools.Parsing.Ast命名空间,在下文中一共展示了NameExpression类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: FunctionDefinition

        public FunctionDefinition(NameExpression name, Parameter[] parameters, Statement body, DecoratorStatement decorators = null) {
            if (name == null) {
                _name = new NameExpression("<lambda>");
                _isLambda = true;
            } else {
                _name = name;
            }

            _parameters = parameters;
            _body = body;
            _decorators = decorators;
        }
开发者ID:omnimark,项目名称:PTVS,代码行数:12,代码来源:FunctionDefinition.cs


示例17: PostWalk

        public override void PostWalk(NameExpression node) {
            if (IsInRange(node)) {
                if(_ast.LanguageVersion.Is2x()) {
                    // In 2.7 True and False are constants, we made an exception to not show them Autos window.
                    if(node.Name == "True" || node.Name == "False") {
                        return;
                    }
                }

                _expressions.Add(node, null);
            }

        }
开发者ID:RussBaz,项目名称:PTVS,代码行数:13,代码来源:ProximityExpressionWalker.cs


示例18: IterableIter

 private IAnalysisSet IterableIter(Node node, AnalysisUnit unit, IAnalysisSet[] args, NameExpression[] keywordArgNames) {
     if (args.Length == 0) {
         return unit.Scope.GetOrMakeNodeValue(
             node,
             n => new IteratorInfo(
                 _indexTypes,
                 IteratorInfo.GetIteratorTypeFromType(ClassInfo, unit),
                 n
             )
         );
     }
     return AnalysisSet.Empty;
 }
开发者ID:omnimark,项目名称:PTVS,代码行数:13,代码来源:IterableInfo.cs


示例19: Call

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

            var res = _callable(node, unit, args, keywordArgNames);
            if (_mergeOriginalAnalysis && _original != null) {
                return res.Union(_original.Call(node, unit, args, keywordArgNames));
            }

            return res;
        }
开发者ID:wenh123,项目名称:PTVS,代码行数:13,代码来源:SpecializedCallable.cs


示例20: ObjectNew

 private IAnalysisSet ObjectNew(Node node, Analysis.AnalysisUnit unit, IAnalysisSet[] args, NameExpression[] keywordArgNames) {
     if (args.Length >= 1) {
         var instance = AnalysisSet.Empty;
         foreach (var n in args[0]) {
             var bci = n as BuiltinClassInfo;
             var ci = n as ClassInfo;
             if (bci != null) {
                 instance = instance.Union(bci.Instance);
             } else if (ci != null) {
                 instance = instance.Union(ci.Instance);
             }
         }
         return instance;
     }
     return ProjectState.ClassInfos[BuiltinTypeId.Object].Instance;
 }
开发者ID:wenh123,项目名称:PTVS,代码行数:16,代码来源:ObjectBuiltinClassInfo.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Ast.Node类代码示例发布时间:2022-05-26
下一篇:
C# Ast.Expression类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap