當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。