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

C# AnalysisValue类代码示例

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

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



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

示例1: UnionMergeTypes

        internal override AnalysisValue UnionMergeTypes(AnalysisValue av, int strength) {
            if (strength >= MergeStrength.ToBaseClass) {
                return _analyzer._zeroIntValue;
            }

            return base.UnionMergeTypes(av, strength);
        }
开发者ID:lioaphy,项目名称:nodejstools,代码行数:7,代码来源:NumberValue.cs


示例2: UnionMergeTypes

        internal override AnalysisValue UnionMergeTypes(AnalysisValue av, int strength) {
            if (strength >= StringUnionStrength) {
                return _analyzer._emptyStringValue;
            }

            return base.UnionMergeTypes(av, strength);
        }
开发者ID:lioaphy,项目名称:nodejstools,代码行数:7,代码来源:StringValue.cs


示例3: GetInstanceShortDescription

 private static string GetInstanceShortDescription(AnalysisValue ns) {
     var bci = ns as BuiltinClassInfo;
     if (bci != null) {
         return bci.Instance.ShortDescription;
     }
     return ns.ShortDescription;
 }
开发者ID:omnimark,项目名称:PTVS,代码行数:7,代码来源:SequenceBuiltinClassInfo.cs


示例4: UnionEquals

 internal override bool UnionEquals(AnalysisValue ns, int strength) {
     var tns = ns as TestNamespace;
     if (tns == null) {
         return false;
     }
     return Name.Equals(tns.Name);
 }
开发者ID:sadapple,项目名称:PTVS,代码行数:7,代码来源:NamespaceSetTest.cs


示例5: UnionMergeTypes

 internal override AnalysisValue UnionMergeTypes(AnalysisValue ns, int strength) {
     var tns = ns as TestNamespace;
     if (tns == null || object.ReferenceEquals(this, tns)) {
         return this;
     }
     return new TestNamespace { _name = Name, Value = MergeCount > tns.MergeCount ? Value : tns.Value, MergeCount = MergeCount + tns.MergeCount };
 }
开发者ID:sadapple,项目名称:PTVS,代码行数:7,代码来源:NamespaceSetTest.cs


示例6: ObjectValue

        public ObjectValue(ProjectEntry projectEntry, AnalysisValue prototype = null, string description = null)
            : base(projectEntry) {
            if (prototype != null) {
                Add("__proto__", prototype.SelfSet);
            }
#if DEBUG
            _description = description;
#endif
        }
开发者ID:CforED,项目名称:Node.js-Tools-for-Visual-Studio,代码行数:9,代码来源:ObjectValue.cs


示例7: InterpreterScope

 protected InterpreterScope(AnalysisValue av, InterpreterScope cloned, bool isCloned) {
     Debug.Assert(isCloned);
     _av = av;
     Children.AddRange(cloned.Children);
     _nodeScopes = cloned._nodeScopes;
     _nodeValues = cloned._nodeValues;
     _variables = cloned._variables;
     _linkedVariables = cloned._linkedVariables;
 }
开发者ID:wenh123,项目名称:PTVS,代码行数:9,代码来源:InterpreterScope.cs


示例8: UnionMergeTypes

        internal override AnalysisValue UnionMergeTypes(AnalysisValue ns, int strength) {
            if (strength >= MergeStrength.ToObject) {
                if (ns is InstanceValue) {
                    return ProjectState._immutableObject;
                }
            }

            return base.UnionMergeTypes(ns, strength);
        }
开发者ID:CforED,项目名称:Node.js-Tools-for-Visual-Studio,代码行数:9,代码来源:InstanceValue.cs


示例9: UnionEquals

        internal override bool UnionEquals(AnalysisValue ns, int strength) {
            if (strength >= MergeStrength.ToObject) {
                if (ns is InstanceValue) {
                    return true;
                }
            }

            return base.UnionEquals(ns, strength);
        }
开发者ID:CforED,项目名称:Node.js-Tools-for-Visual-Studio,代码行数:9,代码来源:InstanceValue.cs


示例10: PushProtoLookup

        internal static bool PushProtoLookup(AnalysisValue value){
            if (_hitCount == null) {
                _hitCount = new Dictionary<AnalysisValue, int>();
            }

            int count;
            if (!_hitCount.TryGetValue(value, out count)) {
                _hitCount[value] = 1;
                return true;
            } else {
                _hitCount[value] = count + 1;
            }
            return false;
        }
开发者ID:CforED,项目名称:Node.js-Tools-for-Visual-Studio,代码行数:14,代码来源:ObjectValue.cs


示例11: UnionMergeTypes

        internal override AnalysisValue UnionMergeTypes(AnalysisValue av, int strength) {
            if (strength >= MergeStrength.ToBaseClass) {
                var literal = av as ObjectLiteralValue;
                if (literal != null) {
                    return this;
                }
            }
            
            if (strength >= MergeStrength.ToBaseClass) {
                var literal = av as ObjectLiteralValue;
                if (literal != null && literal._node == _node) {
                    return this;
                }
            }

            return base.UnionMergeTypes(av, strength);
        }
开发者ID:lioaphy,项目名称:nodejstools,代码行数:17,代码来源:ObjectLiteralValue.cs


示例12: UnionEquals

        internal override bool UnionEquals(AnalysisValue av, int strength) {
            if (strength >= MergeStrength.ToBaseClass) {
                var literal = av as ObjectLiteralValue;
                if (literal != null) {
                    return true;
                }
            }

            if (strength >= MergeStrength.ToBaseClass) {
                var literal = av as ObjectLiteralValue;
                if (literal != null) {
                    // two literals from the same node, these
                    // literals were created by independent function
                    // analysis, merge them together now.
                    return literal._node == _node;
                }
            }
            return base.UnionEquals(av, strength);
        }
开发者ID:lioaphy,项目名称:nodejstools,代码行数:19,代码来源:ObjectLiteralValue.cs


示例13: GetTestCaseMembers

        /// <summary>
        /// Get Test Case Members for a class.  If the class has 'test*' tests 
        /// return those.  If there aren't any 'test*' tests return (if one at 
        /// all) the runTest overridden method
        /// </summary>
        private static IEnumerable<KeyValuePair<string, IAnalysisSet>> GetTestCaseMembers(
            ModuleAnalysis analysis,
            AnalysisValue classValue
        ) {
            var methodFunctions = classValue.GetAllMembers(analysis.InterpreterContext)
                .Where(v => v.Value.Any(m => m.MemberType == PythonMemberType.Function || m.MemberType == PythonMemberType.Method));

            var tests = methodFunctions.Where(v => v.Key.StartsWith("test"));
            var runTest = methodFunctions.Where(v => v.Key.Equals("runTest"));

            if (tests.Any()) {
                return tests;
            } else {
                return runTest;
            }
        }
开发者ID:jsschultz,项目名称:PTVS,代码行数:21,代码来源:TestAnalysisExtension.cs


示例14: UnionEquals

 internal override bool UnionEquals(AnalysisValue ns, int strength) {
     if (strength < MergeStrength.IgnoreIterableNode) {
         if (ns == ProjectState.ClassInfos[BuiltinTypeId.Dict].Instance) {
             return true;
         }
         var ci = ns as ConstantInfo;
         if (ci != null && ci.ClassInfo == ProjectState.ClassInfos[BuiltinTypeId.Dict]) {
             return true;
         }
         var di = ns as DictionaryInfo;
         if (di != null) {
             return di._node.Equals(_node);
         }
         return false;
     }
     return base.UnionEquals(ns, strength);
 }
开发者ID:omnimark,项目名称:PTVS,代码行数:17,代码来源:DictionaryInfo.cs


示例15: IsTestCaseClass

 private static bool IsTestCaseClass(AnalysisValue cls) {
     if (cls == null ||
         cls.DeclaringModule != null ||
         cls.PythonType == null ||
         cls.PythonType.DeclaringModule == null) {
         return false;
     }
     var mod = cls.PythonType.DeclaringModule.Name;
     return (mod == "unittest" || mod.StartsWith("unittest.")) && cls.Name == "TestCase";
 }
开发者ID:jsschultz,项目名称:PTVS,代码行数:10,代码来源:TestAnalysisExtension.cs


示例16: UnionMergeTypes

 internal override AnalysisValue UnionMergeTypes(AnalysisValue ns, int strength) {
     if (strength < MergeStrength.IgnoreIterableNode) {
         return ClassInfo.Instance;
     }
     return base.UnionMergeTypes(ns, strength);
 }
开发者ID:omnimark,项目名称:PTVS,代码行数:6,代码来源:DictionaryInfo.cs


示例17: PopProtoLookup

 internal static void PopProtoLookup(AnalysisValue value) {
     int count = _hitCount[value];
     if (count == 1) {
         _hitCount.Remove(value);
     } else {
         _hitCount[value] = count - 1;
     }
 }
开发者ID:CforED,项目名称:Node.js-Tools-for-Visual-Studio,代码行数:8,代码来源:ObjectValue.cs


示例18: UnionEquals

        internal override bool UnionEquals(AnalysisValue ns, int strength) {
            if (strength >= MergeStrength.ToObject) {
                if (ns.TypeId == BuiltinTypeId.NoneType) {
                    // II + BII(None) => do not merge
                    return false;
                }

                // II + II => BII(object)
                // II + BII => BII(object)
                var obj = ProjectState.ClassInfos[BuiltinTypeId.Object];
                return ns is InstanceInfo || 
                    (ns is BuiltinInstanceInfo && ns.TypeId != BuiltinTypeId.Type && ns.TypeId != BuiltinTypeId.Function) ||
                    ns == obj.Instance;

            } else if (strength >= MergeStrength.ToBaseClass) {
                var ii = ns as InstanceInfo;
                if (ii != null) {
                    return ii.ClassInfo.UnionEquals(ClassInfo, strength);
                }
                var bii = ns as BuiltinInstanceInfo;
                if (bii != null) {
                    return bii.ClassInfo.UnionEquals(ClassInfo, strength);
                }
            }

            return base.UnionEquals(ns, strength);
        }
开发者ID:omnimark,项目名称:PTVS,代码行数:27,代码来源:InstanceInfo.cs


示例19: GetRecurse

 private IAnalysisSet GetRecurse(AnalysisValue protoStart, Node node, AnalysisUnit unit, string name, bool addRef) {
     var prototypes = protoStart.GetPrototype(unit.ProjectEntry);
     IAnalysisSet protovalue = AnalysisSet.Empty;
     if (prototypes != null) {
         try {
             foreach (var proto in prototypes) {
                 if (PushProtoLookup(proto.Value)) {
                     var property = proto.Value.GetProperty(node, unit, name);
                     if (property != null) {
                         var value = property.GetValue(
                             node,
                             unit,
                             proto.Value.DeclaringModule,
                             this.SelfSet,
                             addRef
                         );
                         protovalue = protovalue.Union(value);
                         if (property.IsEphemeral) {
                             protovalue = protovalue.Union(GetRecurse(proto.Value, node, unit, name, addRef));
                         }
                     } else {
                         // keep searching the prototype chain...
                         protovalue = protovalue.Union(GetRecurse(proto.Value, node, unit, name, addRef));
                     }
                 }
             }
         } finally {
             foreach (var proto in prototypes) {
                 PopProtoLookup(proto.Value);
             }
         }
     }
    
     return protovalue;
 }
开发者ID:CforED,项目名称:Node.js-Tools-for-Visual-Studio,代码行数:35,代码来源:ObjectValue.cs


示例20: UnionMergeTypes

        internal override AnalysisValue UnionMergeTypes(AnalysisValue ns, int strength) {
            if (strength >= MergeStrength.ToObject) {
                // II + II => BII(object)
                // II + BII => BII(object)
                //return ProjectState.ClassInfos[BuiltinTypeId.Object].Instance;
#if FALSE
            } else if (strength >= MergeStrength.ToBaseClass) {
                var ii = ns as InstanceInfo;
                if (ii != null) {
                    return ii.ClassInfo.UnionMergeTypes(ClassInfo, strength).GetInstanceType().Single();
                }
                var bii = ns as BuiltinInstanceInfo;
                if (bii != null) {
                    return bii.ClassInfo.UnionMergeTypes(ClassInfo, strength).GetInstanceType().Single();
                }
#endif
            }

            return base.UnionMergeTypes(ns, strength);
        }
开发者ID:CforED,项目名称:Node.js-Tools-for-Visual-Studio,代码行数:20,代码来源:ObjectValue.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# AnalyzeCSharp类代码示例发布时间:2022-05-24
下一篇:
C# AnalysisUnit类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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