{"id":15724285,"url":"https://github.com/cedlemo/truckboris","last_synced_at":"2026-02-18T14:02:12.067Z","repository":{"id":23017990,"uuid":"26368840","full_name":"cedlemo/truckboris","owner":"cedlemo","description":"A C++ tiny library based on Clang that implements a simple C source files parser.","archived":false,"fork":false,"pushed_at":"2016-01-25T15:32:53.000Z","size":7382,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-08T05:43:46.071Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cedlemo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-08T17:47:58.000Z","updated_at":"2016-01-25T15:32:53.000Z","dependencies_parsed_at":"2022-08-21T17:31:48.977Z","dependency_job_id":null,"html_url":"https://github.com/cedlemo/truckboris","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cedlemo/truckboris","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedlemo%2Ftruckboris","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedlemo%2Ftruckboris/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedlemo%2Ftruckboris/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedlemo%2Ftruckboris/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cedlemo","download_url":"https://codeload.github.com/cedlemo/truckboris/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedlemo%2Ftruckboris/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29581513,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T13:56:48.962Z","status":"ssl_error","status_checked_at":"2026-02-18T13:54:34.145Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T22:16:00.274Z","updated_at":"2026-02-18T14:02:12.032Z","avatar_url":"https://github.com/cedlemo.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Truckboris\n\n[![Build Status](https://travis-ci.org/cedlemo/truckboris.svg?branch=master)](https://travis-ci.org/cedlemo/truckboris)\n\nTruckboris is a little library based on Clang (3.4 to 3.8). Truckboris allows you to easily \ncreate a simple C source file parser. \n\n\n## Installation\n\n### Dependencies\n\nTruckBoris depends on LLVM and Clang \u003e= 3.4. You need CPPUNIT (\u003e= 1.12) for the tests.\n\n### Systems tested : \n*    Archlinux (clang 3.4 to 3.7, CppUnit 1.13)\n*    Fedora    (clang 3.5, CppUnit 1.12)\n*    Centos    (clang 3.4, CppUnit 1.12)\n\n### Get the repository:\n\u003ccode\u003egit clone https://github.com/cedlemo/truckboris\u003c/code\u003e\n\n### Generate the make file and install\n\n    ./autogen.sh --prefix=/usr #use the prefix you want\n    make \n    sudo make install\n\nYou can generate the tests in order to see if everything is ok:\n\n    make check\n    ./test/truckBorisTests\n\nWith this configuration, the installation create those files/directory:\n*    /usr/lib/libtruckboris.{so,la,so.1,so.x.x.x}\n*    /usr/include/truckboris with the needed headers.\n*    /usr/include/pkgconfig/truckboris.pc\n\n## Test easily with Vagrant:\nYou can find a Vagrantfile in the root directory of this project. This vagrant file is intended to be used with an archlinux vagrant box.\n\n```\nvagrant box add archlinux-x86_64 http://cloud.terry.im/vagrant/archlinux-x86_64.box\nmkdir truckboris_test\ncd truckboris_test\ncp /path/to/Vagranfile ./\nvagrant up\n```\n\n## Use truckboris:\nFor example, with the file tests/libtest_headerParser_obj.cpp:\n\n\u003ccode\u003eclang++ -o libtest_headerParser_obj $(pkg-config --libs --cflags truckboris) libtest_headerParser_obj.cpp\u003c/code\u003e\n\nYou don't have to bother with the clang LLVM flags.\n\n## Examples:\n\n```c++\n#include \u003cstring\u003e\n#include \u003ciostream\u003e\n#include \u003cvector\u003e\n#include \u003cHeaderParser.h\u003e\n\n#define TEST_SOURCE_FILE \"../data/test.cpp\"\n/*Compile with:\nclang++ -o libtest_headerParser_obj $(pkg-config --libs --cflags truckboris) libtest_headerParser_obj.cpp\n*/\nint main(int argc, char **argv)\n{\n  std::vector\u003cstd::string\u003e hp;\n  hp.push_back(std::string(\"/usr/include\"));\n  TruckBoris::HeaderParser headerParser;\n  headerParser.addSourceFile(std::string(TEST_SOURCE_FILE));\n  headerParser.addSearchPaths(hp);\n\n  if(headerParser.isInitialized())\n    std::cout \u003c\u003c \"Header Parser is initialized \" \u003c\u003c std::endl;\n  else\n    return 1;\n  std::cout \u003c\u003c \"File to parse : \" \u003c\u003c headerParser.getSourceFile() \u003c\u003c std::endl;\n\n  if(headerParser.parse())\n    std::cout \u003c\u003c \"Parsing succeeded \" \u003c\u003c std::endl;\n  else\n    std::cout \u003c\u003c \"Parsing failed \" \u003c\u003c std::endl;\n\n  std::vector\u003cTruckBoris::Function\u003e fns;\n  fns = headerParser.getFunctions();\n  std::cout \u003c\u003c fns.size() \u003c\u003c std::endl;\n  return 0;\n}\n```\n\nThe \u003ccode\u003eTruckBoris::HeaderParser\u003c/code\u003e object, lists all top level functions , typedefs,\nstructures, unions enumerations. When the parsing is done you can get, from  \neach functions for example, its name, its return type or an array of arguments.\n\nYou can see in the file tests/TruckBorisTests.h how to use all the TruckBoris objects\nand methodsi with the source files in data/.\n\n```c++\nvoid setUp()\n{\n  m_headerParser = NULL;\n  std::vector\u003cstd::string\u003e hp;\n  hp.push_back(std::string(\"/usr/include\"));\n  m_headerParser = new TruckBoris::HeaderParser(std::string(TEST_SOURCE_FILE),hp);\n}\n/*-------------------------------*/\nvoid headerParser_testFunctions()\n{\n  CPPUNIT_ASSERT(m_headerParser-\u003eisInitialized() == true);\n  STR_MESSASSERT(m_headerParser-\u003egetSourceFile(), std::string(TEST_SOURCE_FILE) );\n  CPPUNIT_ASSERT(m_headerParser-\u003eparse() == true);\n  std::vector\u003cTruckBoris::Function\u003e f;\n  f = m_headerParser-\u003egetFunctions();\n  STR_MESSASSERT(f[0].getName(), std::string(\"une_fonction\"));\n  CPPUNIT_ASSERT(f[0].getParameters().size() == 2);\n  CPPUNIT_ASSERT(f[0].isMain() == false);\n  STR_MESSASSERT(f[1].getName(), std::string(\"pupute\"));\n  CPPUNIT_ASSERT(f[1].getParameters().size() == 2);\n  CPPUNIT_ASSERT(f[1].isMain() == false);\n  STR_MESSASSERT(f[2].getName(), std::string(\"fonction_vide\"));\n  CPPUNIT_ASSERT(f[2].getParameters().size() == 0);\n  CPPUNIT_ASSERT(f[2].isMain() == false);\n  STR_MESSASSERT(f[3].getName(), std::string(\"main\"));\n  CPPUNIT_ASSERT(f[3].getParameters().size() == 2);\n  CPPUNIT_ASSERT(f[3].isMain() == true);\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcedlemo%2Ftruckboris","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcedlemo%2Ftruckboris","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcedlemo%2Ftruckboris/lists"}