Package cs1302.tracer
Class App
java.lang.Object
cs1302.tracer.App
Entry point for the tracer program.
Normative References:
- The Java Language Specification (Java SE 21 Edition), §12.1.4
(Invoke
void main(String[])). - Picocli Specification 4.7 (Command-line parsing and option binding).
Informative References:
- Online Python Tutor (OPT) Trace Event Format v3 Specification (Philip Guo, 2013).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRun batch traces over NDJSON.static classProvides version string resolved from Maven resource filtering at build time. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List<com.github.javaparser.ast.CompilationUnit> discoverAllCompilationUnits(List<CompilationHelper.SourceFile> sourceFiles, Optional<Path> sourceRoot, Optional<Path> parserSourceRoot) Discovers and parses all compilation units in the source files and source root.static intExecutes the CLI application with given arguments.static voidMain entry point of the CLI application.static com.github.javaparser.ast.CompilationUnitparseSource(String source, Optional<Path> sourceRoot) Parse the given Java source code string with optional source root for type resolution.
-
Constructor Details
-
App
public App()Constructs a newAppcommand-line application instance.Normative Reference: The Picocli command-line parsing specification requires a public zero-argument constructor for command dispatch and instantiation.
-
-
Method Details
-
execute
Executes the CLI application with given arguments.- Parameters:
args- Command-line arguments.- Returns:
- Process exit code.
-
main
Main entry point of the CLI application.- Parameters:
args- Command-line arguments.- Throws:
Exception- If an error occurs.
-
parseSource
public static com.github.javaparser.ast.CompilationUnit parseSource(String source, Optional<Path> sourceRoot) Parse the given Java source code string with optional source root for type resolution.- Parameters:
source- The Java source code to parse.sourceRoot- The root directory where source files for the program are located.- Returns:
- The parsed Java source code.
- Throws:
IllegalArgumentException- If parsing failed.
-
discoverAllCompilationUnits
public static List<com.github.javaparser.ast.CompilationUnit> discoverAllCompilationUnits(List<CompilationHelper.SourceFile> sourceFiles, Optional<Path> sourceRoot, Optional<Path> parserSourceRoot) Discovers and parses all compilation units in the source files and source root.- Parameters:
sourceFiles- Input source files.sourceRoot- Optional source root path.parserSourceRoot- Parser type resolution path.- Returns:
- List of parsed CompilationUnits.
-