Quick and dirty port of jcpp to .NET, with features to support Clang preprocessing
Перейти к файлу
Virgile Bello a17498d595 Switched to .NET Standard 1.3 2020-05-10 16:36:32 +02:00
JavaCompat initial commit 2014-09-25 23:05:30 -05:00
.gitignore Merge remote-tracking branch 'github/master' 2016-07-01 15:21:13 +09:00
.gitmodules [CoreCLR] Added support to compile against CoreCLR. 2015-10-15 10:03:22 +09:00
Argument.cs Fix invalid newlines 2016-07-01 15:06:38 +09:00
CppNet.csproj Switched to .NET Standard 1.3 2020-05-10 16:36:32 +02:00
CppNet.sln Switched to .NET Standard 1.3 2020-05-10 16:36:32 +02:00
CppReader.cs initial commit 2014-09-25 23:05:30 -05:00
CppTask.cs initial commit 2014-09-25 23:05:30 -05:00
Feature.cs Fix invalid newlines 2016-07-01 15:06:38 +09:00
FileLexerSource.cs Switched to Profile32 (Windows 8.1) for Store apps (including UWP) 2016-07-08 13:22:56 +09:00
FixedTokenSource.cs Fix invalid newlines 2016-07-01 15:06:38 +09:00
InputLexerSource.cs initial commit 2014-09-25 23:05:30 -05:00
JavaFile.cs Switched to Profile32 (Windows 8.1) for Store apps (including UWP) 2016-07-08 13:22:56 +09:00
JavaFileSystem.cs Switched to Profile32 (Windows 8.1) for Store apps (including UWP) 2016-07-08 13:22:56 +09:00
JoinReader.cs [CoreCLR] Added support to compile against CoreCLR. 2015-10-15 10:03:22 +09:00
LICENSE Initial commit 2014-09-25 22:26:56 -05:00
LexerException.cs Fix invalid newlines 2016-07-01 15:06:38 +09:00
LexerSource.cs Refactor CoreCLR support 2016-07-01 15:10:11 +09:00
Macro.cs Fix invalid newlines 2016-07-01 15:06:38 +09:00
MacroTokenSource.cs Fix invalid newlines 2016-07-01 15:06:38 +09:00
Preprocessor.cs Switched to Profile32 (Windows 8.1) for Store apps (including UWP) 2016-07-08 13:22:56 +09:00
PreprocessorListener.cs Refactor CoreCLR support 2016-07-01 15:10:11 +09:00
PreprocessorListenerBase.cs Fix invalid newlines 2016-07-01 15:06:38 +09:00
README.md Update README.md 2014-09-25 23:12:34 -05:00
Source.cs Fix invalid newlines 2016-07-01 15:06:38 +09:00
SourceIterator.cs Merge remote-tracking branch 'github/master' 2016-07-01 15:21:13 +09:00
State.cs Fix invalid newlines 2016-07-01 15:06:38 +09:00
StringLexerSource.cs Fix invalid newlines 2016-07-01 15:06:38 +09:00
Token.cs Fix invalid newlines 2016-07-01 15:06:38 +09:00
TokenSnifferSource.cs initial commit 2014-09-25 23:05:30 -05:00
VirtualFile.cs Fix invalid newlines 2016-07-01 15:06:38 +09:00
VirtualFileSystem.cs Fix invalid newlines 2016-07-01 15:06:38 +09:00
Warning.cs Fix invalid newlines 2016-07-01 15:06:38 +09:00

README.md

CppNet

Quick and dirty port of JCPP (https://github.com/shevek/jcpp) to C#, with features to support Clang preprocessing.

Features added from jcpp:

  • __has_include, __has_include_next, __has_feature
  • variadic macros
  • #import
var pp = new Preprocessor();
pp.addFeature(Feature.DIGRAPHS);
pp.addFeature(Feature.TRIGRAPHS);
pp.addFeature(Feature.OBJCSYNTAX);
pp.addWarning(Warning.IMPORT);
pp.addFeature(Feature.INCLUDENEXT);
pp.setListener(new PreprocessorListener());

pp.getSystemIncludePath().Add(@"C:\XcodeDefault.xctoolchain\usr\include");
pp.getSystemIncludePath().Add(@"C:\XcodeDefault.xctoolchain\usr\lib\clang\6.0\include");
pp.getFrameworksPath().Add(@"C:\iPhoneOS8.0.sdk\System\Library\Frameworks");
pp.getSystemIncludePath().Add(@"C:\iPhoneOS8.0.sdk\usr\include");

pp.addMacro("__AARCH64_SIMD__");
pp.addMacro("__ARM64_ARCH_8__");
pp.addMacro("__ARM_NEON__");
pp.addMacro("__LITTLE_ENDIAN__");
pp.addMacro("__REGISTER_PREFIX__", "");
pp.addMacro("__arm64", "1");
pp.addMacro("__arm64__", "1");
pp.addMacro("__APPLE_CC__", "6000");
pp.addMacro("__APPLE__");
pp.addMacro("__GNUC__", "4");
pp.addMacro("OBJC_NEW_PROPERTIES");
pp.addMacro("__STDC_HOSTED__", "1");
pp.addMacro("__MACH__");
Version version = new Version("8.0.0.0");
pp.addMacro("__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__", string.Format("{0:0}{1:00}{2:00}", version.Major, version.Minor, version.Revision));
pp.addMacro("__STATIC__");

pp.addInput(new FileLexerSource("test.m"));