public class PdePreprocessor
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
PdePreprocessor.Mode |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
SIZE_REGEX
Regular expression for parsing the size() method.
|
| Constructor and Description |
|---|
PdePreprocessor(java.lang.String sketchName) |
PdePreprocessor(java.lang.String sketchName,
int tabSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
addMethod(java.lang.String methodName) |
void |
debugAST(AST ast,
boolean includeHidden) |
java.lang.String[] |
getCoreImports() |
java.lang.String[] |
getDefaultImports() |
boolean |
hasMethod(java.lang.String methodName) |
boolean |
ignoreImport(java.lang.String pkg)
Return true if this import should be removed from the code.
|
java.lang.String[] |
initSketchSize(java.lang.String code,
boolean sizeWarning) |
static java.lang.String[] |
parseSketchSize(java.lang.String code,
boolean fussy)
Parse a chunk of code and extract the size() command and its contents.
|
static java.lang.String |
scrubComments(java.lang.String what)
Replace all commented portions of a given String as spaces.
|
void |
setAdvClassName(java.lang.String advClassName) |
void |
setMode(PdePreprocessor.Mode mode) |
PreprocessorResult |
write(java.io.Writer out,
java.lang.String program) |
PreprocessorResult |
write(java.io.Writer out,
java.lang.String program,
java.lang.String[] codeFolderPackages) |
public static final java.lang.String SIZE_REGEX
public PdePreprocessor(java.lang.String sketchName)
public PdePreprocessor(java.lang.String sketchName,
int tabSize)
public java.lang.String[] initSketchSize(java.lang.String code,
boolean sizeWarning)
throws SketchException
SketchExceptionpublic static java.lang.String[] parseSketchSize(java.lang.String code,
boolean fussy)
code - Usually the code from the main tab in the sketchfussy - true if it should show an error message if bad size()public static java.lang.String scrubComments(java.lang.String what)
public void addMethod(java.lang.String methodName)
public boolean hasMethod(java.lang.String methodName)
public void setAdvClassName(java.lang.String advClassName)
public void setMode(PdePreprocessor.Mode mode)
public PreprocessorResult write(java.io.Writer out, java.lang.String program) throws SketchException, RecognitionException, TokenStreamException
SketchExceptionRecognitionExceptionTokenStreamExceptionpublic PreprocessorResult write(java.io.Writer out, java.lang.String program, java.lang.String[] codeFolderPackages) throws SketchException, RecognitionException, TokenStreamException
SketchExceptionRecognitionExceptionTokenStreamExceptionpublic java.lang.String[] getCoreImports()
public java.lang.String[] getDefaultImports()
public boolean ignoreImport(java.lang.String pkg)
pkg - something like processing.xml.XMLElement or processing.xml.*public void debugAST(AST ast,
boolean includeHidden)