Package ghidra.app.decompiler
Class PrettyPrinter
- java.lang.Object
-
- ghidra.app.decompiler.PrettyPrinter
-
public class PrettyPrinter extends java.lang.Object
This class is used to convert a C language token group into readable C code.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
INDENT_STRING
The indent string to use when printing.
-
Constructor Summary
Constructors Constructor Description PrettyPrinter(Function function, ClangTokenGroup tokgroup)
Constructs a new pretty printer using the specified C language token group.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Function
getFunction()
java.util.ArrayList<ClangLine>
getLines()
Returns an array list of the C language lines contained in the C language token group.DecompiledFunction
print(boolean removeInvalidChars)
Prints the C language token group into a string of C code.
-
-
-
Field Detail
-
INDENT_STRING
public static final java.lang.String INDENT_STRING
The indent string to use when printing.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
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 Detail
-
getFunction
public Function getFunction()
-
getLines
public java.util.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
-
-