Class PrettyPrinter

java.lang.Object
ghidra.app.decompiler.PrettyPrinter

public class PrettyPrinter extends Object
This class is used to convert a C/C++ language token group into readable C/C++ code.
  • Field Details

  • Constructor Details

    • PrettyPrinter

      public PrettyPrinter(Function function, ClangTokenGroup tokgroup, NameTransformer transformer)
      Constructs a new pretty printer using the specified C language token group. The printer takes a NameTransformer that will be applied to symbols, which can replace illegal characters in the symbol name for instance. A null indicates no transform is applied.
      Parameters:
      function - is the function to be printed
      tokgroup - the C language token group
      transformer - the transformer to apply to symbols
  • Method Details

    • getFunction

      public Function getFunction()
    • getLines

      public List<ClangLine> getLines()
      Returns a list of the C language lines contained in the C language token group.
      Returns:
      a list of the C language lines
    • print

      public DecompiledFunction print()
      Prints the C language token group into a string of C code.
      Returns:
      a string of readable C code