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


C# SyntaxTree.syntax_tree_node类代码示例

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


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

示例1: write_syntax_tree_node

		public void write_syntax_tree_node(syntax_tree_node _syntax_tree_node)
		{
			if (_syntax_tree_node.source_context == null)
			{
				bw.Write((byte)0);
			}
			else
			{
				bw.Write((byte)1);
				if (_syntax_tree_node.source_context.begin_position == null)
				{
					bw.Write((byte)0);
				}
				else
				{
					bw.Write((byte)1);
					bw.Write(_syntax_tree_node.source_context.begin_position.line_num);
					bw.Write(_syntax_tree_node.source_context.begin_position.column_num);
				}
				if (_syntax_tree_node.source_context.end_position == null)
				{
					bw.Write((byte)0);
				}
				else
				{
					bw.Write((byte)1);
					bw.Write(_syntax_tree_node.source_context.end_position.line_num);
					bw.Write(_syntax_tree_node.source_context.end_position.column_num);
				}
			}
		}
开发者ID:Slav76,项目名称:pascalabcnet,代码行数:31,代码来源:SyntaxTreeStreamWriter.cs

示例2: node

		public static string node(syntax_tree_node tn)
		{
			string_ref sr=new string_ref();
			get_node_info gni=new get_node_info(sr);
			tn.visit(gni);
			return sr.s;
		}
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:7,代码来源:get_node_info.cs

示例3: VarFinderSyntaxVisitor

 /// <summary>
 /// Конструктор
 /// </summary>
 /// <param name="root">Корень обходимого поддерева</param>
 /// <param name="context">Контекст. Необходим для поиска переменных</param>
 /// <param name="isForNode">True при обходе цикла, False при обходе секций</param>
 public VarFinderSyntaxVisitor(syntax_tree_node root, compilation_context context, bool isForNode)
 {
     this.isForNode = isForNode;
     this.context = context;
     ProcessNode(root);
     FixResultVar();
 }
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:13,代码来源:VarFinderSyntaxVisitor.cs

示例4: prepare_node

        public void prepare_node(syntax_tree_node subnode, string node_name)
		{
			if (subnode==null)
			{
				return;
			}
			prepare_node_with_text(subnode,node_name+":"+subnode.GetType().Name);
		}
开发者ID:Slav76,项目名称:pascalabcnet,代码行数:8,代码来源:visualizator.cs

示例5: Enter

 public override void Enter(syntax_tree_node st)
 {
     base.Enter(st);
     if (!(st is procedure_definition || st is block || st is statement_list || st is case_node || st is for_node || st is foreach_stmt || st is if_node || st is repeat_node || st is while_node || st is with_statement || st is try_stmt || st is lock_stmt))
     {
         //visitNode = false;
     }
 }
开发者ID:PascalABC-CompilerLaboratory,项目名称:pascalabcnet,代码行数:8,代码来源:LoweringVisitor.cs

示例6: CapturedVariablesTreeNode

 protected CapturedVariablesTreeNode(CapturedVariablesTreeNode parentNode, int scopeNum, syntax_tree_node correspondingSyntaxTreeNode)
 {
     ParentNode = parentNode;
     ChildNodes = new List<CapturedVariablesTreeNode>();
     VariablesDefinedInScope = new List<CapturedSymbolInfo>();
     ScopeIndex = scopeNum;
     CorrespondingSyntaxTreeNode = correspondingSyntaxTreeNode;
     LambdasDefinedInScope = new List<CapturedVariablesTreeNodeLambdaScope>();
 }
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:9,代码来源:CapturedVariablesTreeNode.cs

示例7: Find

        public syntax_tree_node Find(SyntaxTree.compilation_unit unit, SourceContext findContext)
        {
            _findContext = findContext;
            _findResult = null;
            //unit.visit(this);
            ProcessNode(unit);

            return _findResult;
        }
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:9,代码来源:CompilerDirectivesToSyntaxTreeNodesLinker.cs

示例8: Enter

 public override void Enter(syntax_tree_node st)
 {
     base.Enter(st);
     // Не заходим во вложенные циклы, там свои break-continue
     if ((st is for_node || st is foreach_stmt || st is while_node || st is repeat_node))
     {
         visitNode = false;
     }
 }
开发者ID:Slav76,项目名称:pascalabcnet,代码行数:9,代码来源:ReplaceBreakContinueWithGotoLabelVisitor.cs

示例9: Exit

 public override void Exit(syntax_tree_node st)
 {
     if (st.GetType() == typeof(program_module))
     {
         var t = (DateTime.Now - d).Milliseconds;
         fs.WriteLine(t.ToString());
         fs.Close();
     }
         
 }
开发者ID:Slav76,项目名称:pascalabcnet,代码行数:10,代码来源:SampleSyntaxTreeConverter.cs

示例10: Enter

 public override void Enter(syntax_tree_node st)
 {
     base.Enter(st);
     if (st is procedure_definition || st is class_definition)
     {
         list.Add(st as declaration);
         if (PrintInfo)
             Console.Write("+: "+st.GetType().Name);
     }
 }
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:10,代码来源:CollectNamespaces.cs

示例11: Enter

 public override void Enter(syntax_tree_node st)
 {
     if (d.ContainsKey(st.GetType()))
         d[st.GetType()] += 1;
     else d[st.GetType()] = 1;
     if (st is expression)
         exprcount++;
     if (st is statement)
         statcount++;
 }
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:10,代码来源:CountNodesVisitor.cs

示例12: Exit

 public override void Exit(syntax_tree_node st)
 {
     if (st is procedure_definition || st is class_definition)
     {
         if (PrintInfo)
             Console.WriteLine("-: " + st.GetType().Name);
         list.RemoveAt(list.Count - 1);
     }
     base.Exit(st);
 }
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:10,代码来源:CollectNamespaces.cs

示例13: Enter

        public override void Enter(syntax_tree_node st)
        {
            base.Enter(st);
            countNodesVisited++;

            // сокращение обходимых узлов. Как сделать фильтр по тем узлам, которые необходимо обходить? Например, все операторы (без выражений и описаний), все описания (без операторов)
            if (st is assign || st is var_def_statement || st is procedure_call || st is procedure_header || st is expression)
            {
                visitNode = false; // фильтр - куда не заходить 
            }
        }
开发者ID:PascalABC-CompilerLaboratory,项目名称:pascalabcnet,代码行数:11,代码来源:ProcessYieldsCapturedVars.cs

示例14: Enter

 public override void Enter(syntax_tree_node st)
 {
     base.Enter(st);
     if (!(st is procedure_definition || st is block || st is statement_list 
         || st.GetType() == typeof(case_node) || st.GetType() == typeof(for_node) || st.GetType() == typeof(foreach_stmt) 
         || st.GetType() == typeof(if_node) 
         || st.GetType() == typeof(repeat_node) || st.GetType() == typeof(while_node) 
         || st.GetType() == typeof(with_statement) || st is try_stmt || st.GetType() == typeof(lock_stmt)))
     {
         //visitNode = false;
     }
 }
开发者ID:Slav76,项目名称:pascalabcnet,代码行数:12,代码来源:LoweringVisitor.cs

示例15: NewProgramModule

        public program_module NewProgramModule(program_name progName, Object optHeadCompDirs, uses_list mainUsesClose, syntax_tree_node progBlock, Object optPoint, LexLocation loc)
        {
            var progModule = new program_module(progName, mainUsesClose, progBlock as block, null, loc);
            progModule.Language = LanguageId.PascalABCNET;
            if (optPoint == null && progBlock != null)
            {
                var fp = progBlock.source_context.end_position;
                var err_stn = progBlock;
			    if ((progBlock is block) && (progBlock as block).program_code != null && (progBlock as block).program_code.subnodes != null && (progBlock as block).program_code.subnodes.Count > 0)
                    err_stn = (progBlock as block).program_code.subnodes[(progBlock as block).program_code.subnodes.Count - 1];
                parsertools.errors.Add(new PABCNETUnexpectedToken(parsertools.CurrentFileName, StringResources.Get("TKPOINT"), new SourceContext(fp.line_num, fp.column_num + 1, fp.line_num, fp.column_num + 1, 0, 0), err_stn));
            }
            return progModule;
        }
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:14,代码来源:SemanticRules.cs


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