diff --git a/cmake-build-release/.ninja_deps b/cmake-build-release/.ninja_deps index 0276b50..6478ee8 100644 Binary files a/cmake-build-release/.ninja_deps and b/cmake-build-release/.ninja_deps differ diff --git a/cmake-build-release/.ninja_log b/cmake-build-release/.ninja_log index c7eada0..693d69e 100644 --- a/cmake-build-release/.ninja_log +++ b/cmake-build-release/.ninja_log @@ -1,10 +1,10 @@ # ninja log v5 3 1437 1703269248001211383 libraries/BLT/CMakeFiles/BLT.dir/src/blt/std/string.cpp.o 7372d87554025941 -1 1383 1703299843831973242 CMakeFiles/gl_doc_generator.dir/src/main.cpp.o f2846e1dc111dd8 +1 1319 1703313187097385701 CMakeFiles/gl_doc_generator.dir/src/main.cpp.o f2846e1dc111dd8 3 3035 1703269249601195503 libraries/BLT/CMakeFiles/BLT.dir/src/blt/std/system.cpp.o 6b34ee1aa4557b8 4 6430 1703269252993161839 libraries/BLT/CMakeFiles/BLT.dir/src/blt/profiling/profiler_v2.cpp.o f7d76198a6666d0a 3 4901 1703269251465177003 libraries/BLT/CMakeFiles/BLT.dir/src/blt/profiling/profiler.cpp.o 98c3613a268835f7 -0 552 1703299907953718140 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 +1 505 1703313186281395730 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 2 4864 1703269251429177360 libraries/BLT/CMakeFiles/BLT.dir/src/blt/std/format.cpp.o 86854dbc10b97205 5 6828 1703269253393157869 libraries/BLT/CMakeFiles/BLT.dir/src/blt/parse/argparse.cpp.o c25a8a66b746b95f 6829 6962 1703269253521156599 libraries/BLT/libBLT.a f5b601d9b774b003 @@ -12,83 +12,13 @@ 2 2026 1703269248589205547 libraries/BLT/CMakeFiles/BLT.dir/src/blt/std/loader.cpp.o c1e2cebc92cff5ff 4 891 1703269247453216823 libraries/BLT/CMakeFiles/BLT.dir/src/blt/nbt/nbt_block.cpp.o c189cbf7574512a 4 3961 1703269250525186332 libraries/BLT/CMakeFiles/BLT.dir/src/blt/nbt/nbt.cpp.o 439363bdbfdd4452 -552 591 1703299907989719007 gl_doc_generator 7126d327cf7747a5 +1319 1357 1703313187133385258 gl_doc_generator 7126d327cf7747a5 1 1470 1703269248033211066 libraries/BLT/CMakeFiles/BLT.dir/src/blt/std/filesystem.cpp.o 1c0fd59b23c040f5 1 2400 1703269248965201816 libraries/BLT/CMakeFiles/BLT.dir/src/blt/std/assert.cpp.o 8c3d34b2a042cd0c -1 553 1703299929682218495 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 -553 593 1703299929722219376 gl_doc_generator 7126d327cf7747a5 -1 1387 1703299942986503590 CMakeFiles/gl_doc_generator.dir/src/main.cpp.o f2846e1dc111dd8 -1387 1440 1703299943038504672 gl_doc_generator 7126d327cf7747a5 -0 1394 1703299946414574483 CMakeFiles/gl_doc_generator.dir/src/main.cpp.o f2846e1dc111dd8 -1394 1435 1703299946454575304 gl_doc_generator 7126d327cf7747a5 -1 543 1703299973027090309 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 -543 587 1703299973071091110 gl_doc_generator 7126d327cf7747a5 -0 523 1703299995183474531 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 -523 565 1703299995223475188 gl_doc_generator 7126d327cf7747a5 -1 528 1703300016059800637 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 -528 566 1703300016095801169 gl_doc_generator 7126d327cf7747a5 -2 517 1703310567873168039 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 -2 1321 1703310568677158438 CMakeFiles/gl_doc_generator.dir/src/main.cpp.o f2846e1dc111dd8 -1321 1357 1703310568713158009 gl_doc_generator 7126d327cf7747a5 -1 502 1703311348035650648 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 -502 539 1703311348071650203 gl_doc_generator 7126d327cf7747a5 -0 504 1703311392543100518 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 -504 538 1703311392579100073 gl_doc_generator 7126d327cf7747a5 -1 512 1703311407042921199 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 -512 552 1703311407078920754 gl_doc_generator 7126d327cf7747a5 -1 511 1703311428046661372 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 -511 546 1703311428078660975 gl_doc_generator 7126d327cf7747a5 -1 477 1703311480934006756 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 -478 514 1703311480970006310 gl_doc_generator 7126d327cf7747a5 -0 540 1703311516285568914 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 -540 578 1703311516321568468 gl_doc_generator 7126d327cf7747a5 -1 477 1703311721775020226 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 -477 514 1703311721811019778 gl_doc_generator 7126d327cf7747a5 -2 504 1703311739758796925 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 -504 542 1703311739798796428 gl_doc_generator 7126d327cf7747a5 -2 487 1703311756414590085 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 -487 522 1703311756446589687 gl_doc_generator 7126d327cf7747a5 -2 503 1703311797742114758 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 -503 539 1703311797778114345 gl_doc_generator 7126d327cf7747a5 -1 473 1703311814637921052 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 -473 509 1703311814673920637 gl_doc_generator 7126d327cf7747a5 -2 503 1703311830625737303 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 -503 539 1703311830661736890 gl_doc_generator 7126d327cf7747a5 -2 486 1703311842329602524 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 -486 522 1703311842365602110 gl_doc_generator 7126d327cf7747a5 -1 502 1703311864213349927 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 -502 540 1703311864253349465 gl_doc_generator 7126d327cf7747a5 -2 484 1703311876481207999 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 -484 520 1703311876517207582 gl_doc_generator 7126d327cf7747a5 -1 497 1703311898840948731 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 -497 533 1703311898876948313 gl_doc_generator 7126d327cf7747a5 -1 532 1703311942400441603 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 -532 566 1703311942432441229 gl_doc_generator 7126d327cf7747a5 -1 512 1703311976096047572 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 -512 548 1703311976132047151 gl_doc_generator 7126d327cf7747a5 -1 490 1703311988163906105 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 -490 523 1703311988195905730 gl_doc_generator 7126d327cf7747a5 -1 569 1703312010271646502 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 -569 616 1703312010319645938 gl_doc_generator 7126d327cf7747a5 -1 485 1703312059543065912 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 -485 520 1703312059575065534 gl_doc_generator 7126d327cf7747a5 -1 488 1703312068326962126 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 -488 522 1703312068362961701 gl_doc_generator 7126d327cf7747a5 -1 481 1703312136238157131 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 -481 516 1703312136270156751 gl_doc_generator 7126d327cf7747a5 -0 486 1703312190901506099 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 -486 521 1703312190937505669 gl_doc_generator 7126d327cf7747a5 -1 487 1703312215757209248 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 -487 523 1703312215793208818 gl_doc_generator 7126d327cf7747a5 -1 504 1703312277440470542 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 -504 538 1703312277476470111 gl_doc_generator 7126d327cf7747a5 -1 469 1703312387731143303 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 -469 503 1703312387763142918 gl_doc_generator 7126d327cf7747a5 -0 463 1703312412602843024 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 -463 496 1703312412634842636 gl_doc_generator 7126d327cf7747a5 -1 497 1703312444138461824 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 -497 532 1703312444170461437 gl_doc_generator 7126d327cf7747a5 -1 475 1703312462394240923 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 -475 510 1703312462430240488 gl_doc_generator 7126d327cf7747a5 -1 502 1703312506333708595 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 -502 537 1703312506365708207 gl_doc_generator 7126d327cf7747a5 +1 634 1703316313529228992 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 +1 1475 1703316327113168829 CMakeFiles/gl_doc_generator.dir/src/main.cpp.o f2846e1dc111dd8 +1475 1531 1703316327169168575 gl_doc_generator 7126d327cf7747a5 +1 1448 1703316339001113988 CMakeFiles/gl_doc_generator.dir/src/main.cpp.o f2846e1dc111dd8 +1448 1500 1703316339049113762 gl_doc_generator 7126d327cf7747a5 +1 603 1703316356065031799 CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o e3be46751e904b25 +603 652 1703316356113031561 gl_doc_generator 7126d327cf7747a5 diff --git a/cmake-build-release/CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o b/cmake-build-release/CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o index 490669a..5068872 100644 Binary files a/cmake-build-release/CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o and b/cmake-build-release/CMakeFiles/gl_doc_generator.dir/src/load_file.cpp.o differ diff --git a/cmake-build-release/CMakeFiles/gl_doc_generator.dir/src/main.cpp.o b/cmake-build-release/CMakeFiles/gl_doc_generator.dir/src/main.cpp.o index 6d29506..6fa3877 100644 Binary files a/cmake-build-release/CMakeFiles/gl_doc_generator.dir/src/main.cpp.o and b/cmake-build-release/CMakeFiles/gl_doc_generator.dir/src/main.cpp.o differ diff --git a/cmake-build-release/Testing/Temporary/LastTest.log b/cmake-build-release/Testing/Temporary/LastTest.log index 5e4398c..f18d6cb 100644 --- a/cmake-build-release/Testing/Temporary/LastTest.log +++ b/cmake-build-release/Testing/Temporary/LastTest.log @@ -1,3 +1,3 @@ -Start testing: Dec 23 01:22 EST +Start testing: Dec 23 02:25 EST ---------------------------------------------------------- -End testing: Dec 23 01:22 EST +End testing: Dec 23 02:25 EST diff --git a/cmake-build-release/gl_doc_generator b/cmake-build-release/gl_doc_generator index 5a32753..153b074 100755 Binary files a/cmake-build-release/gl_doc_generator and b/cmake-build-release/gl_doc_generator differ diff --git a/src/load_file.cpp b/src/load_file.cpp index bca05b9..b6e3db0 100644 --- a/src/load_file.cpp +++ b/src/load_file.cpp @@ -17,6 +17,7 @@ */ #include "load_file.h" #include +#include namespace blt { @@ -114,7 +115,7 @@ namespace blt while (end > 0 && std::isspace(data[end])) end--; // end isn't inclusive - end+=1; + end += 1; // begin is auto begin = end - 1; while (begin > 0 && is_ident(data[begin])) @@ -138,14 +139,45 @@ namespace blt break; } } - BLT_DEBUG("Finished in state %d", (int) state); +// BLT_DEBUG("Finished in state %d", (int) state); // BLT_DEBUG("With data %s", parsed.c_str()); return *this; } void parser::process_gl_func(std::string_view func_name) { - BLT_INFO("Running on function %s", std::string(func_name).c_str()); +// std::string reference_link = "https://registry.khronos.org/OpenGL-Refpages/gl4/html/"; +// reference_link.reserve(func_name.length() + 6); +// reference_link += func_name; +// reference_link += ".xhtml"; +// auto pid = popen(pythonPath + " " + generatorPath + " " + reference_link, "r"); +// BLT_INFO("Running on function %s", std::string(func_name).c_str()); + std::cout << std::string(func_name) << std::endl; + } + + std::string_view parser::strip_func(std::string_view func) + { + auto pos = func.find("Matrix"); + if (pos == std::string_view::npos) + { + for (size_t i = 0; i < func.size(); i++) + { + char c = func[i]; + switch (c) + { + case 'i': + case 'f': + case 'u': + pos = i - 1; + break; + default: + break; + } + if (pos != std::string_view ::npos) + break; + } + } + return std::string_view(); } } \ No newline at end of file diff --git a/src/load_file.h b/src/load_file.h index 445432b..a905374 100644 --- a/src/load_file.h +++ b/src/load_file.h @@ -32,7 +32,7 @@ namespace blt OTHER, // literally anything else (we do not care about it) PREPROCESSOR_DEFINE, // #define IDENTIFIER, // either a variable or a type (void / thisismyvar) - POSSIBLE_FUNC, + POSSIBLE_FUNC, // we had an identifier and found a space FUNCTION // myfunctioname( }; @@ -50,6 +50,9 @@ namespace blt std::string file; std::string data; std::string parsed; + + std::string pythonPath; + std::string generatorPath; state_type state = state_type::OTHER; std::vector parsed_tokens; @@ -70,10 +73,12 @@ namespace blt return std::isalnum(c) || c == '_'; } + std::string_view strip_func(std::string_view func); void process_gl_func(std::string_view func_name); public: - explicit parser(std::string_view path): path(path) + explicit parser(std::string_view path, std::string_view pythonPath, std::string_view generatorPath): + path(path), pythonPath(pythonPath), generatorPath(generatorPath) {} parser& load_file(); diff --git a/src/main.cpp b/src/main.cpp index 9c66982..c6a697b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -25,11 +25,11 @@ int main(int argc, const char** argv) BLT_INFO("Using %s on file %s", generatorPath.c_str(), filePath.c_str()); - blt::parser file_parser(filePath); + blt::parser file_parser(filePath, pythonPath, generatorPath); file_parser.load_file().parse(); auto vec = file_parser.get(); - BLT_DEBUG("Result:\n%s", vec.c_str()); + //BLT_DEBUG("Result:\n%s", vec.c_str()); return 0; } diff --git a/test.h b/test.h index 2967dd9..adfa24e 100644 --- a/test.h +++ b/test.h @@ -25,6 +25,10 @@ int ident = 0; +// TODO: +typedef void (*glCopyTextureSubImage3D)(int n, const int * pipelines); + + void glDrawTransformFeedbackStream() {