Package processing.mode.java.preproc
Class SourceUtil
java.lang.Object
processing.mode.java.preproc.SourceUtil
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int[]checkForMissingBraces(CharSequence c, int start, int end) Checks a single code fragment (such as a tab) for non-matching braces.static List<TextTransform.Edit>fixFloatsRegex(CharSequence source) static intDetermine how many times a string appears in another.static List<ImportStatement>parseProgramImports(CharSequence source) static List<TextTransform.Edit>preprocessAST(org.eclipse.jdt.core.dom.CompilationUnit cu) static List<TextTransform.Edit>replaceColorRegex(CharSequence source) static List<TextTransform.Edit>replaceHexLiterals(CharSequence source) static List<TextTransform.Edit>replaceTypeConstructors(CharSequence source) static void
-
Field Details
-
IMPORT_REGEX
-
IMPORT_REGEX_NO_KEYWORD
-
TYPE_CONSTRUCTOR_REGEX
-
HEX_LITERAL_REGEX
-
FLOATING_POINT_LITERAL_VERIFIER
-
COLOR_TYPE_REGEX
-
NUMBER_LITERAL_REGEX
-
-
Constructor Details
-
SourceUtil
public SourceUtil()
-
-
Method Details
-
parseProgramImports
-
replaceTypeConstructors
-
replaceHexLiterals
-
preprocessAST
-
replaceColorRegex
-
fixFloatsRegex
-
scrubCommentsAndStrings
-
checkForMissingBraces
Checks a single code fragment (such as a tab) for non-matching braces. Broken out to allow easy use in JavaBuild.- Parameters:
c- Program code scrubbed of comments and string literals.start- Start index, inclusive.end- End index, exclusive.- Returns:
int[4]Depth at which the loop stopped, followed by the line number, column, and string index (within the range) at which an error was found, if any.
-
getCount
Determine how many times a string appears in another.- Parameters:
body- The string in which occurrences should be counted.search- The string to look for.- Returns:
- The number of times search appears in body.
-