|
ACAV f0ba4b7c9529
Abstract Syntax Tree (AST) visualization tool for C, C++, and Objective-C
|
Runs the make-ast tool to generate AST cache files. More...
#include <MakeAstRunner.h>
Signals | |
| void | astReady (const QString &astFilePath) |
| Emitted when make-ast completes successfully. | |
| void | error (const QString &errorMessage) |
| Emitted when an error occurs. | |
| void | progress (const QString &message) |
| Emitted with progress updates. | |
| void | logMessage (const LogEntry &entry) |
| Emitted when the tool produces log output. | |
Public Member Functions | |
| MakeAstRunner (QObject *parent=nullptr) | |
| void | run (const QString &compilationDatabasePath, const QString &sourceFilePath, const QString &outputFilePath, const QString &makeAstBinary=QString()) |
| Run make-ast tool for specified source file. | |
| bool | isRunning () const |
| Check if tool is currently running. | |
| void | terminate () |
| Attempts to terminate the process gracefully Sends SIGTERM on Unix/macOS, WM_CLOSE on Windows. | |
| void | kill () |
| Kills the process immediately Sends SIGKILL on Unix/macOS, forceful termination on Windows. | |
| void | setClangResourceDir (const QString &dir) |
| Set the Clang resource directory. | |
| bool | waitForFinished (int msecs=30000) |
| Waits for the process to finish. | |
Runs the make-ast tool to generate AST cache files.
This class provides a Qt-based interface to run the make-ast command-line tool using QProcess. It executes the tool, waits for completion, and emits signals for success or error.
Usage: MakeAstRunner runner; connect(&runner, &MakeAstRunner::astReady, this, &MyClass::onAstReady); connect(&runner, &MakeAstRunner::error, this, &MyClass::onError); runner.run(compDb, sourceFile, outputPath);
Definition at line 50 of file MakeAstRunner.h.
|
explicit |
Definition at line 31 of file MakeAstRunner.cpp.
|
override |
Definition at line 43 of file MakeAstRunner.cpp.
|
signal |
Emitted when make-ast completes successfully.
| astFilePath | Path to generated .ast file |
|
signal |
Emitted when an error occurs.
| errorMessage | Description of the error |
Referenced by logMessage(), and run().
| bool acav::MakeAstRunner::isRunning | ( | ) | const |
Check if tool is currently running.
Definition at line 89 of file MakeAstRunner.cpp.
References isRunning().
Referenced by isRunning(), and run().
| void acav::MakeAstRunner::kill | ( | ) |
Kills the process immediately Sends SIGKILL on Unix/macOS, forceful termination on Windows.
Definition at line 99 of file MakeAstRunner.cpp.
References kill().
Referenced by kill().
|
signal |
Emitted with progress updates.
| message | Progress message (e.g., "Generating AST for file.cpp...") |
Referenced by run().
| void acav::MakeAstRunner::run | ( | const QString & | compilationDatabasePath, |
| const QString & | sourceFilePath, | ||
| const QString & | outputFilePath, | ||
| const QString & | makeAstBinary = QString() ) |
Run make-ast tool for specified source file.
| compilationDatabasePath | Path to compile_commands.json |
| sourceFilePath | Path to source file to parse |
| outputFilePath | Path where .ast file should be written |
| makeAstBinary | Path to make-ast executable (defaults to app dir) |
Definition at line 50 of file MakeAstRunner.cpp.
References error(), isRunning(), progress(), and run().
Referenced by run().
|
inline |
Set the Clang resource directory.
| dir | Path to clang resource dir (lib/clang/<ver>) |
Definition at line 80 of file MakeAstRunner.h.
| void acav::MakeAstRunner::terminate | ( | ) |
Attempts to terminate the process gracefully Sends SIGTERM on Unix/macOS, WM_CLOSE on Windows.
Definition at line 93 of file MakeAstRunner.cpp.
References terminate().
Referenced by terminate().
| bool acav::MakeAstRunner::waitForFinished | ( | int | msecs = 30000 | ) |
Waits for the process to finish.
| msecs | Maximum time to wait in milliseconds (default: 30000ms) |
Definition at line 105 of file MakeAstRunner.cpp.
References waitForFinished().
Referenced by waitForFinished().