Add preprocessor
The parser now parses macros and inclusion directives.
This commit is contained in:
parent
ac8b81400c
commit
0684be5788
6 changed files with 519 additions and 11 deletions
31
src/libclang/preprocessor.hpp
Normal file
31
src/libclang/preprocessor.hpp
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
// Copyright (C) 2017 Jonathan Müller <jonathanmueller.dev@gmail.com>
|
||||
// This file is subject to the license terms in the LICENSE file
|
||||
// found in the top-level directory of this distribution.
|
||||
|
||||
#ifndef CPPAST_PREPROCESSOR_HPP_INCLUDED
|
||||
#define CPPAST_PREPROCESSOR_HPP_INCLUDED
|
||||
|
||||
#include <cppast/cpp_preprocessor.hpp>
|
||||
#include <cppast/libclang_parser.hpp>
|
||||
|
||||
namespace cppast
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
struct pp_entity
|
||||
{
|
||||
std::unique_ptr<cpp_entity> entity;
|
||||
unsigned line;
|
||||
};
|
||||
|
||||
struct preprocessor_output
|
||||
{
|
||||
std::string source;
|
||||
std::vector<pp_entity> entities;
|
||||
};
|
||||
|
||||
preprocessor_output preprocess(const libclang_compile_config& config, const char* path);
|
||||
}
|
||||
} // namespace cppast::detail
|
||||
|
||||
#endif // CPPAST_PREPROCESSOR_HPP_INCLUDED
|
||||
Loading…
Add table
Add a link
Reference in a new issue