JavaParser

Converts Java to C.

Methods
static ClassObj getBuiltInClass(String type)
Get the class for a built-in type.
static ClassObj getBuiltInClass(String type)
Get the class for a built-in type.
Parameters:
type - the type
Returns:
the class or null if not found
static String indent(String o)
Move the source code 4 levels to the right.
static String indent(String o)
Move the source code 4 levels to the right.
Parameters:
o - the source code
Returns:
the indented code
static String readNumber(String s)
Parse a number literal and returns it.
static String readNumber(String s)
Parse a number literal and returns it.
Parameters:
s - the source code
Returns:
the number
static String removeRemarks(String s)
Replace all Unicode escapes and remove all remarks.
static String removeRemarks(String s)
Replace all Unicode escapes and remove all remarks.
Parameters:
s - the source code
Returns:
the cleaned source code
static String replaceUnicode(String s)
Replace all Unicode escapes.
static String replaceUnicode(String s)
Replace all Unicode escapes.
Parameters:
s - the text
Returns:
the cleaned text
static String toC(String identifier)
Get the C++ representation of this identifier.
static String toC(String identifier)
Get the C++ representation of this identifier.
Parameters:
identifier - the identifier
Returns:
the C representation
ClassObj getClassObj()
ClassObj getClassObj()
ClassObj getClassObj(String className)
Get the class of the given name.
ClassObj getClassObj(String className)
Get the class of the given name.
Parameters:
className - the name
Returns:
the class
ClassObj getWrapper(ClassObj c)
Get the wrapper class for the given primitive class.
ClassObj getWrapper(ClassObj c)
Get the wrapper class for the given primitive class.
Parameters:
c - the class
Returns:
the wrapper class
void parse(String baseDir, String className)
Parse the source code.
void parse(String baseDir, String className)
Parse the source code.
Parameters:
baseDir - the base directory
className - the fully qualified name of the class to parse
void writeHeader(PrintWriter out)
Write the C++ header.
void writeHeader(PrintWriter out)
Write the C++ header.
Parameters:
out - the output writer
void writeSource(PrintWriter out)
Write the C++ source code.
void writeSource(PrintWriter out)
Write the C++ source code.
Parameters:
out - the output writer

Fields
static boolean REF_COUNT = false
static boolean REF_COUNT_STATIC = false

REF_COUNT = false

Whether ref-counting is used.

REF_COUNT_STATIC = false

Whether ref-counting is used for constants.