How to generate AST for Single file
After building in Linux using the steps https://github.com/satya-das/cppparser#building-cppparser.
cppparsertest binary is generated.
How to Parse a single file?
You can use it as a library like this:
#include <string>
struct A{
std::string x;
};
#include "cppparser.h"
#include <filesystem>
#include <iostream>
namespace fs = std::filesystem;
int main(){
CppParser parser;
const auto ast = parser.parseFile(std::string("path/to/your/file.cpp"));
}
Then compile, adding pub to your include dirs and linking boost_filesystem, boost_program_options and boost_system, which should have been generated in your build directory.
I get the following errors when building, could you give some hints how to solve it?
When you referring to " linking boost_filesystem, boost_program_options and boost_system" , does this mean adding the following dirs to the linking path?
Are you still getting this error?
Closing this issue for now. If you are still getting this error, please reopen the issue.