mirror of
https://github.com/logos-co/logos-cpp-sdk.git
synced 2026-09-01 02:01:08 +00:00
24 lines
806 B
C
24 lines
806 B
C
#ifndef C_HEADER_PARSER_H
|
|
#define C_HEADER_PARSER_H
|
|
|
|
#include "lidl_ast.h"
|
|
#include <QString>
|
|
#include <QTextStream>
|
|
|
|
struct CHeaderParseResult {
|
|
ModuleDecl module;
|
|
QString prefix; // detected or supplied function prefix (e.g. "rust_calc_")
|
|
QString error;
|
|
bool hasError() const { return !error.isEmpty(); }
|
|
};
|
|
|
|
// Parse a C header with plain function declarations.
|
|
// Functions matching {prefix}{method_name}(args) are extracted as module methods.
|
|
// prefix: if empty, auto-derived as "{module_name}_" from metadata.json name field.
|
|
CHeaderParseResult parseCHeader(const QString& headerPath,
|
|
const QString& prefix,
|
|
const QString& metadataPath,
|
|
QTextStream& err);
|
|
|
|
#endif // C_HEADER_PARSER_H
|