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


C# Ast.Node类代码示例

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


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

示例1: AnalysisUnit

 private AnalysisUnit(Node ast, InterpreterScope[] scopes, AnalysisUnit parent, bool forEval)
 {
     _ast = ast;
     _scopes = scopes;
     _parent = parent;
     _forEval = forEval;
 }
开发者ID:TerabyteX,项目名称:main,代码行数:7,代码来源:AnalysisUnit.cs

示例2: Call

        public override ISet<Namespace> Call(Node node, AnalysisUnit unit, ISet<Namespace>[] args, string[] keywordArgNames)
        {
            if (args.Length == 1) {
                _list.AppendItem(args[0]);
            }

            return ProjectState._noneInst.SelfSet;
        }
开发者ID:TerabyteX,项目名称:main,代码行数:8,代码来源:ListAppendBoundBuiltinMethodInfo.cs

示例3: Call

        public override ISet<Namespace> Call(Node node, AnalysisUnit unit, ISet<Namespace>[] args, string[] keywordArgNames)
        {
            if (args.Length == 1) {
                _generator.AddSend(node, unit, args[0]);
            }

            return _generator.Yields;
        }
开发者ID:TerabyteX,项目名称:main,代码行数:8,代码来源:GeneratorSendBoundBuiltinMethodInfo.cs

示例4: GetMember

 public override ISet<Namespace> GetMember(Node node, AnalysisUnit unit, string name)
 {
     var res = base.GetMember(node, unit, name);
     if (res.Count > 0) {
         _references.AddReference(node, unit, name);
     }
     return res;
 }
开发者ID:TerabyteX,项目名称:main,代码行数:8,代码来源:ReflectedNamespace.cs

示例5: Call

        public override ISet<Namespace> Call(Node node, AnalysisUnit unit, ISet<Namespace>[] args, string[] keywordArgNames)
        {
            if (args.Length == 1) {
                foreach (var type in args[0]) {
                    _list.AppendItem(type.GetEnumeratorTypes(node, unit));
                }
            }

            return ProjectState._noneInst.SelfSet;
        }
开发者ID:TerabyteX,项目名称:main,代码行数:10,代码来源:ListExtendBoundBuiltinFunction.cs

示例6: CreateVariable

 public VariableDef CreateVariable(Node node, AnalysisUnit unit, string name, bool addRef = true)
 {
     var res = GetVariable(node, unit, name, addRef);
     if (res == null) {
         _variables[name] = res = new VariableDef();
         if (addRef) {
             res.AddReference(node, unit);
         }
     }
     return res;
 }
开发者ID:TerabyteX,项目名称:main,代码行数:11,代码来源:InterpreterScope.cs

示例7: SetUpFixture

		public void SetUpFixture()
		{
			componentCreator = new MockComponentCreator();

			AssignmentStatement assignment = PythonParserHelper.GetAssignmentStatement(GetPythonCode());
			rhsAssignmentNode = assignment.Right;
			
			mockDesignerLoaderHost = new MockDesignerLoaderHost();
			typeResolutionService = mockDesignerLoaderHost.TypeResolutionService;
			PythonCodeDeserializer deserializer = new PythonCodeDeserializer(componentCreator);
			deserializedObject = deserializer.Deserialize(rhsAssignmentNode);
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:12,代码来源:DeserializeAssignmentTestFixtureBase.cs

示例8: GetIndex

        public override ISet<Namespace> GetIndex(Node node, AnalysisUnit unit, ISet<Namespace> index)
        {
            // TODO: Return correct index value if we have a constant
            /*int? constIndex = SequenceInfo.GetConstantIndex(index);

            if (constIndex != null && constIndex.Value < _indexTypes.Count) {
                // TODO: Warn if outside known index and no appends?
                return _indexTypes[constIndex.Value];
            }*/

            return ProjectState._intType.SelfSet;
        }
开发者ID:TerabyteX,项目名称:main,代码行数:12,代码来源:RangeInfo.cs

示例9: 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 ISet<Namespace> Call(this ISet<Namespace> self, Node node, AnalysisUnit unit, ISet<Namespace>[] args, string[] keywordArgNames)
        {
            ISet<Namespace> res = EmptySet<Namespace>.Instance;
            bool madeSet = false;
            foreach (var ns in self) {
                var call = ns.Call(node, unit, args, keywordArgNames);
                Debug.Assert(call != null);

                res = res.Union(call, ref madeSet);
            }

            return res;
        }
开发者ID:TerabyteX,项目名称:main,代码行数:17,代码来源:NamespaceSetExtensions.cs

示例10: BinaryOperation

 public override ISet<Namespace> BinaryOperation(Node node, AnalysisUnit unit, PythonOperator operation, ISet<Namespace> rhs)
 {
     switch (operation) {
         case PythonOperator.GreaterThan:
         case PythonOperator.LessThan:
         case PythonOperator.LessThanOrEqual:
         case PythonOperator.GreaterThanOrEqual:
         case PythonOperator.Equal:
         case PythonOperator.NotEqual:
         case PythonOperator.Is:
         case PythonOperator.IsNot:
             return ProjectState._boolType.Instance;
     }
     return base.BinaryOperation(node, unit, operation, rhs);
 }
开发者ID:TerabyteX,项目名称:main,代码行数:15,代码来源:NumericInstanceInfo.cs

示例11: BinaryOperation

        public static ISet<Namespace> BinaryOperation(this ISet<Namespace> self, Node node, AnalysisUnit unit, PythonOperator operation, ISet<Namespace> rhs)
        {
            ISet<Namespace> res = null;
            bool madeSet = false;
            foreach (var ns in self) {
                ISet<Namespace> got = ns.BinaryOperation(node, unit, operation, rhs);
                if (res == null) {
                    res = got;
                    continue;
                } else if (!madeSet) {
                    res = new HashSet<Namespace>(res);
                    madeSet = true;
                }
                res.UnionWith(got);
            }

            return res ?? EmptySet<Namespace>.Instance;
        }
开发者ID:TerabyteX,项目名称:main,代码行数:18,代码来源:NamespaceSetExtensions.cs

示例12: GetMember

        public override ISet<Namespace> GetMember(Node node, AnalysisUnit unit, string name)
        {
            switch (name) {
                case "append":
                    EnsureAppend();
                    return _appendMethod.SelfSet;
                case "pop":
                    EnsurePop();
                    return _popMethod.SelfSet;
                case "insert":
                    EnsureInsert();
                    return _insertMethod.SelfSet;
                case "extend":
                    EnsureExtend();
                    return _extendMethod.SelfSet;
            }

            return base.GetMember(node, unit, name);
        }
开发者ID:TerabyteX,项目名称:main,代码行数:19,代码来源:ListInfo.cs

示例13: Deserialize

		/// <summary>
		/// Creates or gets the object specified in the python AST.
		/// </summary>
		/// <returns>
		/// Null if the node cannot be deserialized.
		/// </returns>
		public object Deserialize(Node node)
		{
			if (node == null) {
				throw new ArgumentNullException("node");
			}
	
			if (node is CallExpression) {
				return Deserialize((CallExpression)node);
			} else if (node is BinaryExpression) {
				return Deserialize((BinaryExpression)node);
			} else if (node is MemberExpression) {
				return Deserialize((MemberExpression)node);
			} else if (node is UnaryExpression) {
				return Deserialize((UnaryExpression)node);
			} else if (node is ConstantExpression) {
				return Deserialize((ConstantExpression)node);
			} else if (node is NameExpression) {
				return Deserialize((NameExpression)node);
			}
			return null;
		}
开发者ID:Rpinski,项目名称:SharpDevelop,代码行数:27,代码来源:PythonCodeDeserializer.cs

示例14: Locate

        public bool Locate(int line, int column, out Node node, out Scope scope)
        {
            Locator locator = new Locator(line, column);
            global.Walk(locator);

            node = locator.Candidate;
            scope = locator.Scope != null ? scopes[locator.Scope] : null;

            #if DEBUG
            if (node != null)
            {
                Debug.Print("Located {0} at {1}:{2}-{3}:{4}",
                    node,
                    node.Start.Line, node.Start.Column,
                    node.End.Line, node.End.Column
                );
            }
            #endif

            return node != null;
        }
开发者ID:kageyamaginn,项目名称:VSSDK-Extensibility-Samples,代码行数:21,代码来源:Modules.cs

示例15: CommonWalk

 private void CommonWalk(Node node)
 {
     tree.Push(node);
 }
开发者ID:valdisz,项目名称:PyToJs,代码行数:4,代码来源:JavascriptGenerator.cs


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