/[eiffelstudio]/branches/eth/eve/Src/framework/program_analysis/utility/epa_utility.e
ViewVC logotype

Diff of /branches/eth/eve/Src/framework/program_analysis/utility/epa_utility.e

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 85849 by jasonw, Wed Mar 9 16:29:03 2011 UTC revision 85850 by msteindorfer, Fri Mar 11 16:09:48 2011 UTC
# Line 31  inherit Line 31  inherit
31    
32  feature -- AST  feature -- AST
33    
34          text_from_ast (a_ast: AST_EIFFEL): STRING          text_from_ast (a_ast: AST_EIFFEL): like text_from_ast_with_printer
35                          -- Text from `a_ast'                          -- Text from `a_ast', printed via the default `ast_printer' that is configured with `ast_printer_output'.
36                  require                  require
37                          a_ast_attached: a_ast /= Void                          a_ast_attached: a_ast /= Void
38                  do                  do
39                          ast_printer_output.reset                          Result := text_from_ast_with_printer (a_ast, ast_printer)
40                          ast_printer.print_ast_to_output (a_ast)                  end
41                          Result := ast_printer_output.string_representation  
42            text_from_ast_with_printer (a_ast: AST_EIFFEL; a_ast_printer: ETR_AST_STRUCTURE_PRINTER): STRING
43                            -- Text from `a_ast', printed via `a_ast_printer' that has to be configured with a {ETR_AST_STRING_OUTPUT}.
44                    require
45                            a_ast_attached: a_ast /= Void
46                            a_ast_printer_attached: a_ast_printer /= Void
47                            a_ast_printer_has_string_output_attached: attached {ETR_AST_STRING_OUTPUT} a_ast_printer.output
48                    do
49                            a_ast_printer.output.reset
50                            a_ast_printer.print_ast_to_output (a_ast)
51    
52                            if attached {ETR_AST_STRING_OUTPUT} a_ast_printer.output as l_ast_printer_output then
53                                    Result := l_ast_printer_output.string_representation
54                            end
55                    ensure
56                            result_attached: Result /= Void
57                  end                  end
58    
59          ast_printer: ETR_AST_STRUCTURE_PRINTER          ast_printer: ETR_AST_STRUCTURE_PRINTER
60                          -- AST printer                          -- Default AST printer
                 local  
                         l_output: ETR_AST_STRING_OUTPUT  
61                  once                  once
62                          create Result.make_with_output (ast_printer_output)                          create Result.make_with_output (ast_printer_output)
63                  end                  end

Legend:
Removed from v.85849  
changed lines
  Added in v.85850

  ViewVC Help
Powered by ViewVC 1.1.23