From f59978893fed309ff19bacd787398c4bab4aa7c8 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Mon, 4 May 2020 13:46:24 -0400 Subject: C++ Extractor (#1337) * WIP: Doing texing using slangs lexer for cpp-extractor * Node tree for C++ extraction. * Bug fixing. Add dump of hierarchy. * First pass at extracting fields. * Parse template types. * Use diagnostics defs for C++ extractor. * Simplify Diagnostic Defs. * Remove the brace stack. * Added IdentifierLookup. * Add handling for >> style template close. * Improved identifier handling/keywords. * Added ability to check if reader is at cursor position. * Handling of an unspecified root type. * Parsing code comments. Tidy up some parsing - to use advanceIf functions more. * Improve path handling. * Fixes around changes to Path interface. * Working Range, Type and Scope header. * Extract the middle part of marker and put in output. Gives more flexibility at macro injection, and in class definitions. * Split DERIVED types into it's own macro, to provide way to generate for derived types. * Fix clang/g++ compile issue. * Tabs -> spaces. * Fix small bug in getFileNameWithoutExt * Small improvement around naming. Co-authored-by: Tim Foley --- premake5.lua | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'premake5.lua') diff --git a/premake5.lua b/premake5.lua index f0fb7b341..9ebbf6dab 100644 --- a/premake5.lua +++ b/premake5.lua @@ -274,6 +274,7 @@ function addSourceDir(path) path .. "/*.natvis", -- Visual Studio debugger visualization files } end + -- -- Next we will define a helper routine that all of our -- projects will bottleneck through. Here `name` is @@ -540,6 +541,33 @@ tool "slang-test" includedirs { "." } links { "core", "slang" } +-- +-- The cpp extractor is a tool that scans C++ header files to extract +-- reflection like information, and generate files to handle +-- RTTI fast/simply +--- + +tool "slang-cpp-extractor" + uuid "CA8A30D1-8FA9-4330-B7F7-84709246D8DC" + includedirs { "." } + + files { + "source/slang/slang-lexer.cpp", + "source/slang/slang-lexer.h", + "source/slang/slang-source-loc.cpp", + "source/slang/slang-source-loc.h", + "source/slang/slang-file-system.cpp", + "source/slang/slang-file-system.h", + "source/slang/slang-diagnostics.cpp", + "source/slang/slang-diagnostics.h", + "source/slang/slang-name.cpp", + "source/slang/slang-name.h", + "source/slang/slang-token.cpp", + "source/slang/slang-token.h", + } + + links { "core" } + -- -- The reflection test harness `slang-reflection-test` is pretty -- simple, in that it only needs to link against the slang library @@ -550,6 +578,7 @@ toolSharedLibrary "slang-reflection-test" uuid "C5ACCA6E-C04D-4B36-8516-3752B3C13C2F" includedirs { "." } + kind "SharedLib" links { "core", "slang" } -- cgit v1.2.3