Пример #1
0
        private void get_body(statement_list sl, ICSharpCode.NRefactory.Ast.BlockStatement stmt)
        {
            block block_stmt = new block();

            block_stmt.source_context = get_source_context(stmt);
            sl.subnodes.Add(get_statement_list(stmt));
        }
Пример #2
0
        private block get_body(ICSharpCode.NRefactory.Ast.BlockStatement body)
        {
            block blck = new block();

            blck.source_context = get_source_context(body);
            statement_list sl = new statement_list();

            sl.source_context = blck.source_context;
            blck.program_code = sl;
            foreach (ICSharpCode.NRefactory.Ast.INode stmt in body.Children)
            {
                if (stmt is ICSharpCode.NRefactory.Ast.LocalVariableDeclaration)
                {
                    get_var_statement(sl, stmt as ICSharpCode.NRefactory.Ast.LocalVariableDeclaration);
                }
                //else if (stmt is ICSharpCode.NRefactory.Ast.ForStatement)
                //	get_for_statement(sl,stmt as ICSharpCode.NRefactory.Ast.ForStatement);
                else if (stmt is ICSharpCode.NRefactory.Ast.WithStatement)
                {
                    get_with_statement(sl, stmt as ICSharpCode.NRefactory.Ast.WithStatement);
                }
                else if (stmt is ICSharpCode.NRefactory.Ast.BlockStatement)
                {
                    get_body(sl, stmt as ICSharpCode.NRefactory.Ast.BlockStatement);
                }
                //else if (stmt is ICSharpCode.NRefactory.Ast.SwitchStatement)
                //	get_switch_statement(sl, stmt as ICSharpCode.NRefactory.Ast.SwitchStatement);
                else if (stmt is ICSharpCode.NRefactory.Ast.ForNextStatement)
                {
                    get_fornext_statement(sl, stmt as ICSharpCode.NRefactory.Ast.ForNextStatement);
                }
            }
            return(blck);
        }
Пример #3
0
 private statement_list get_statement_list(ICSharpCode.NRefactory.Ast.BlockStatement body)
 {
     return(get_body(body).program_code);
 }