Class PrettyPrinter

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

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

  • Constructor Details

    • PrettyPrinter

      public PrettyPrinter(Function function, ClangTokenGroup tokgroup)
      Constructs a new pretty printer using the specified C language token group.
      Parameters:
      tokgroup - the C language token group
  • Method Details

    • getFunction

      public Function getFunction()
    • getLines

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

      public DecompiledFunction print(boolean removeInvalidChars)
      Prints the C language token group into a string of C code.
      Parameters:
      removeInvalidChars - true if invalid character should be removed from functions and labels.
      Returns:
      a string of readable C code