Package processing.mode.java.preproc
Class PreprocessorResult
java.lang.Object
processing.mode.java.preproc.PreprocessorResult
Result of sketch Preprocessing.
-
Constructor Summary
ConstructorsConstructorDescriptionPreprocessorResult(PdePreprocessor.Mode newProgramType, int newHeaderOffset, String newClassName, List<ImportStatement> newImportStatements, List<TextTransform.Edit> newEdits, String newSketchWidth, String newSketchHeight, String newSketchRenderer) Create a new preprocessing result.PreprocessorResult(PdePreprocessor.Mode newProgramType, int newHeaderOffset, String newClassName, List<ImportStatement> newImportStatements, List<TextTransform.Edit> newEdits, String newSketchWidth, String newSketchHeight, String newSketchRenderer, List<PdePreprocessIssue> newPreprocessIssues) Create a new preprocessing result with errors -
Method Summary
Modifier and TypeMethodDescriptionGet the name of the Java class containing the sketch after preprocessing.getEdits()Get the edits generated during preprocessing.intGet the end point of the header.Get the found import statements as {ImportStatement}s.Get the list of preprocess issues encountered.Get the type of program that was parsed.Get the user provided height of this sketch.Get the user provided renderer of this sketch.Get the user provided width of this sketch.static PreprocessorResultreportPreprocessIssues(List<PdePreprocessIssue> newPreprocessIssues) Create a new PreprocessorResult indicating that there were issues in preprocessing.
-
Constructor Details
-
PreprocessorResult
public PreprocessorResult(PdePreprocessor.Mode newProgramType, int newHeaderOffset, String newClassName, List<ImportStatement> newImportStatements, List<TextTransform.Edit> newEdits, String newSketchWidth, String newSketchHeight, String newSketchRenderer) Create a new preprocessing result.- Parameters:
newProgramType- The type of program that has be preprocessed.newHeaderOffset- The offset (in number of chars) from the start of the program at which the header finishes.newClassName- The name of the class containing the sketch.newImportStatements- The imports required for the sketch including defaults and core imports.newEdits- The edits made during preprocessing.newSketchWidth- The width of the sketch in pixels or special value like displayWidth;newSketchHeight- The height of the sketch in pixels or special value like displayWidth;newSketchRenderer- The renderer of the sketch.
-
PreprocessorResult
public PreprocessorResult(PdePreprocessor.Mode newProgramType, int newHeaderOffset, String newClassName, List<ImportStatement> newImportStatements, List<TextTransform.Edit> newEdits, String newSketchWidth, String newSketchHeight, String newSketchRenderer, List<PdePreprocessIssue> newPreprocessIssues) Create a new preprocessing result with errors- Parameters:
newProgramType- The type of program that has be preprocessed.newHeaderOffset- The offset (in number of chars) from the start of the program at which the header finishes.newClassName- The name of the class containing the sketch.newImportStatements- The imports required for the sketch including defaults and core imports.newEdits- The edits made during preprocessing.newSketchWidth- The width of the sketch in pixels or special value like displayWidth;newSketchHeight- The height of the sketch in pixels or special value like displayWidth;newSketchRenderer- The renderer of the sketch.
-
-
Method Details
-
reportPreprocessIssues
public static PreprocessorResult reportPreprocessIssues(List<PdePreprocessIssue> newPreprocessIssues) Create a new PreprocessorResult indicating that there were issues in preprocessing.- Parameters:
newPreprocessIssues- The list of issues encoutnered.- Returns:
- New preprocessor result.
-
getPreprocessIssues
Get the list of preprocess issues encountered.- Returns:
- List of preprocess issues encountered.
-
getHeaderOffset
public int getHeaderOffset()Get the end point of the header.- Returns:
- The offset (in number of lines) from the start of the program at which the header finishes.
-
getClassName
Get the name of the Java class containing the sketch after preprocessing.- Returns:
- The name of the class containing the sketch.
-
getProgramType
Get the type of program that was parsed.- Returns:
- Type of program parsed like STATIC (no function) or ACTIVE.
-
getEdits
Get the edits generated during preprocessing.- Returns:
- List of edits generated during preprocessing.
-
getImportStatements
Get the found import statements as {ImportStatement}s.- Returns:
- The import statements found for the user.
-
getSketchWidth
Get the user provided width of this sketch.- Returns:
- The width of the sketch in pixels or special value like displayWidth or null if none given.
-
getSketchHeight
Get the user provided height of this sketch.- Returns:
- The height of the sketch in pixels or special value like displayHeight or null if none given.
-
getSketchRenderer
Get the user provided renderer of this sketch.- Returns:
- The renderer of the sketch or null if none given.
-