Tools and libraries to glue C/C++ APIs to high-level languages
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

107 lines
1.9 KiB

/************************************************************************
*
* CppSharp
* Licensed under the simplified BSD license. All rights reserved.
*
************************************************************************/
#pragma once
#include "AST.h"
#include "Helpers.h"
#include "Target.h"
namespace CppSharp { namespace CppParser {
using namespace CppSharp::CppParser::AST;
struct CS_API ParserOptions
{
ParserOptions();
VECTOR_STRING(Arguments)
// C/C++ header file name.
STRING(FileName)
// Include directories
VECTOR_STRING(IncludeDirs)
VECTOR_STRING(SystemIncludeDirs)
VECTOR_STRING(Defines)
VECTOR_STRING(LibraryDirs)
CppSharp::CppParser::AST::ASTContext* ASTContext;
int ToolSetToUse;
STRING(TargetTriple)
CppAbi Abi;
bool NoStandardIncludes;
bool NoBuiltinIncludes;
bool MicrosoftMode;
bool Verbose;
};
enum struct ParserDiagnosticLevel
{
Ignored,
Note,
Warning,
Error,
Fatal
};
struct CS_API ParserDiagnostic
{
ParserDiagnostic();
ParserDiagnostic(const ParserDiagnostic&);
STRING(FileName)
STRING(Message)
ParserDiagnosticLevel Level;
int LineNumber;
int ColumnNumber;
};
enum struct ParserResultKind
{
Success,
Error,
FileNotFound
};
struct Parser;
struct CS_API ParserResult
{
ParserResult();
ParserResult(const ParserResult&);
~ParserResult();
ParserResultKind Kind;
VECTOR(ParserDiagnostic, Diagnostics)
CppSharp::CppParser::AST::ASTContext* ASTContext;
CppSharp::CppParser::AST::NativeLibrary* Library;
Parser* Parser;
};
enum class SourceLocationKind
{
Invalid,
Builtin,
CommandLine,
System,
User
};
class CS_API ClangParser
{
public:
static ParserResult* ParseHeader(ParserOptions* Opts);
static ParserResult* ParseLibrary(ParserOptions* Opts);
static ParserTargetInfo* GetTargetInfo(ParserOptions* Opts);
};
} }