|
LLZK 0.1.0
Veridise's ZK Language IR
|
RAII wrapper for Clang lexer infrastructure. More...
#include <CommonCAPIGen.h>
Classes | |
| struct | Impl |
Public Member Functions | |
| ClangLexerContext (mlir::StringRef source, mlir::StringRef bufferName="input") | |
| Construct a lexer context for the given source code. | |
| clang::Lexer & | getLexer () const |
| Get the lexer instance. | |
| clang::SourceManager & | getSourceManager () const |
| Get the source manager instance. | |
| bool | isValid () const |
| Check if the lexer was successfully created. | |
RAII wrapper for Clang lexer infrastructure.
This class simplifies setting up Clang's lexer for parsing C++ code snippets. It manages the lifetime of all required Clang objects (FileManager, SourceManager, DiagnosticsEngine, etc.) and provides easy access to the lexer.
The Lexer is used instead of the Parser so that comments preceding method declarations can be captured for documentation generation.
Definition at line 215 of file CommonCAPIGen.h.
|
explicit |
Construct a lexer context for the given source code.
| source | The C++ source code to lex |
| bufferName | Optional name for the memory buffer (for diagnostics) |
Definition at line 134 of file CommonCAPIGen.cpp.
| Lexer & ClangLexerContext::getLexer | ( | ) | const |
Get the lexer instance.
Definition at line 163 of file CommonCAPIGen.cpp.
| SourceManager & ClangLexerContext::getSourceManager | ( | ) | const |
Get the source manager instance.
Definition at line 168 of file CommonCAPIGen.cpp.
|
inline |
Check if the lexer was successfully created.
Definition at line 232 of file CommonCAPIGen.h.