Browse Source

Cleaned up Parser.h.

pull/53/merge
triton 12 years ago
parent
commit
88229d8b71
  1. 91
      src/Parser/Options.h
  2. 101
      src/Parser/Parser.h

91
src/Parser/Options.h

@ -0,0 +1,91 @@ @@ -0,0 +1,91 @@
/************************************************************************
*
* CppSharp
* Licensed under the simplified BSD license. All rights reserved.
*
************************************************************************/
#using <CppSharp.AST.dll>
#include <vcclr.h>
using namespace System::Collections::Generic;
public ref struct ParserOptions
{
ParserOptions()
{
IncludeDirs = gcnew List<System::String^>();
SystemIncludeDirs = gcnew List<System::String^>();
Defines = gcnew List<System::String^>();
LibraryDirs = gcnew List<System::String^>();
MicrosoftMode = false;
NoStandardIncludes = false;
NoBuiltinIncludes = false;
}
// Include directories
List<System::String^>^ IncludeDirs;
List<System::String^>^ SystemIncludeDirs;
List<System::String^>^ Defines;
List<System::String^>^ LibraryDirs;
// C/C++ header file name.
System::String^ FileName;
CppSharp::AST::Library^ Library;
int ToolSetToUse;
System::String^ TargetTriple;
bool NoStandardIncludes;
bool NoBuiltinIncludes;
bool MicrosoftMode;
CppSharp::AST::CppAbi Abi;
bool Verbose;
};
public enum struct ParserDiagnosticLevel
{
Ignored,
Note,
Warning,
Error,
Fatal
};
public value struct ParserDiagnostic
{
System::String^ FileName;
System::String^ Message;
ParserDiagnosticLevel Level;
int LineNumber;
int ColumnNumber;
};
public enum struct ParserResultKind
{
Success,
Error,
FileNotFound
};
public ref struct ParserResult
{
ParserResult()
{
Diagnostics = gcnew List<ParserDiagnostic>();
}
ParserResultKind Kind;
CppSharp::AST::Library^ Library;
List<ParserDiagnostic>^ Diagnostics;
};
enum class SourceLocationKind
{
Invalid,
Builtin,
CommandLine,
System,
User
};

101
src/Parser/Parser.h

@ -24,6 +24,10 @@ @@ -24,6 +24,10 @@
#include <clang/Parse/ParseAST.h>
#include <clang/Sema/Sema.h>
#include "CXXABI.h"
#include "Options.h"
#include <string>
typedef std::string String;
namespace clang {
class TargetCodeGenInfo;
@ -32,98 +36,8 @@ namespace clang { @@ -32,98 +36,8 @@ namespace clang {
}
}
#include <string>
#include <cstdarg>
#using <CppSharp.AST.dll>
#include <vcclr.h>
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0]))
#define Debug printf
using namespace System::Collections::Generic;
public ref struct ParserOptions
{
ParserOptions()
{
IncludeDirs = gcnew List<System::String^>();
SystemIncludeDirs = gcnew List<System::String^>();
Defines = gcnew List<System::String^>();
LibraryDirs = gcnew List<System::String^>();
MicrosoftMode = false;
NoStandardIncludes = false;
NoBuiltinIncludes = false;
}
// Include directories
List<System::String^>^ IncludeDirs;
List<System::String^>^ SystemIncludeDirs;
List<System::String^>^ Defines;
List<System::String^>^ LibraryDirs;
// C/C++ header file name.
System::String^ FileName;
CppSharp::AST::Library^ Library;
int ToolSetToUse;
System::String^ TargetTriple;
bool NoStandardIncludes;
bool NoBuiltinIncludes;
bool MicrosoftMode;
CppSharp::AST::CppAbi Abi;
bool Verbose;
};
public enum struct ParserDiagnosticLevel
{
Ignored,
Note,
Warning,
Error,
Fatal
};
public value struct ParserDiagnostic
{
System::String^ FileName;
System::String^ Message;
ParserDiagnosticLevel Level;
int LineNumber;
int ColumnNumber;
};
public enum struct ParserResultKind
{
Success,
Error,
FileNotFound
};
public ref struct ParserResult
{
ParserResult()
{
Diagnostics = gcnew List<ParserDiagnostic>();
}
ParserResultKind Kind;
CppSharp::AST::Library^ Library;
List<ParserDiagnostic>^ Diagnostics;
};
enum class SourceLocationKind
{
Invalid,
Builtin,
CommandLine,
System,
User
};
struct Parser
{
Parser(ParserOptions^ Opts);
@ -195,10 +109,3 @@ protected: @@ -195,10 +109,3 @@ protected:
clang::TargetCodeGenInfo* CodeGenInfo;
clang::CodeGen::CodeGenTypes* CodeGenTypes;
};
//-----------------------------------//
typedef std::string String;
String StringFormatArgs(const char* str, va_list args);
String StringFormat(const char* str, ...);

Loading…
Cancel
Save