libclang Questions

5

I am using Linux Mint and I installed clang_complete using the makefile from Clang Complete, but it does not work. When I open a cpp file, there is an error message: Loading libclang failed, comple...
Ferrari asked 29/3, 2014 at 16:54

2

Solved

I have an instance of CXCursor of kind CXCursor_CXXMethod. I want to find out if the function is const or volatile, for example: class Foo { public: void bar() const; void baz() volatile; void ...
Bunny asked 19/8, 2012 at 12:41

4

Solved

In the following header file I'd like to get the corresponding +reflect comment to the class and member variable: #ifndef __HEADER_FOO #define __HEADER_FOO //+reflect class Foo { public: privat...
Eley asked 29/9, 2013 at 14:16

2

I use ubuntu 20.04.2. I had some problems with rStudio so I unistalled completelly from my computer. I already have installed r, but now I want to install rStudio but when I try to I get that 'libc...
Zelmazelten asked 4/5, 2021 at 11:9

4

Solved

While running doxygen I get the following error: doxygen: error while loading shared libraries: libclang.so.6: cannot open shared object file: No such file or directory I have installed doxygen ...
Twohanded asked 11/3, 2018 at 13:19

4

How can I get a function's signature (or at least the entire definition?) as a string using Clang/Libclang, assuming I have its CXCursor or so? I think that the definition may be somehow obtainabl...
Dirk asked 1/8, 2017 at 6:57

1

I am toying with the Python bindings of libclang. Currently, I am trying to perform some very simple tasks, such as finding all the headers included in a C++ file. The code I use is as follows: fro...
Ireneirenic asked 13/10, 2015 at 13:15

4

How can I get the value of a primitive literal using libclang? For example, if I have a CXCursor of cursor kind CXCursor_IntegerLiteral, how can I extract the literal value. UPDATE: I've run i...
Gudrin asked 21/5, 2012 at 20:18

2

Short description: using libclang to autocomplete code does not work with python that comes bundled with Sublime Text 3. Details: A small verifiable example is in the repo on Github In essence, t...
Famished asked 12/6, 2016 at 13:6

3

Solved

Suppose I have an enum definition, e.g.: // myenum.h enum MyEnum { First = 1, Second, Third, TwoAgain = Second }; I would like to programmatically generate a map from any given enum definiti...
Nebiim asked 24/3, 2015 at 15:24

1

I use libclang to parse source file and get reference to some type as CXType, say it is "const std::__1::basic_string<char>" (as reported by clang_getTypeSpelling). How can I get reference to...
Bladderwort asked 21/7, 2017 at 13:47

1

Following this question and Andrew's suggestions, I am trying to have liblang add the compiler system include paths (in Windows) in order for my Python code import clang.cindex def parse_decl(nod...
Priorate asked 9/5, 2016 at 10:18

0

Background Please see https://github.com/tingraldi/SwiftScripting/issues/18 for a full discussion of this problem. The link above has a long Python script that translates an Objective-C File.h head...
Auricular asked 4/10, 2018 at 6:29

1

To get started with libclang, I build a very simple program that tries to load a very simple source file. It fails with 'stddef.h' file not found. Here is the program using libclang: #include &l...
Euphony asked 20/9, 2018 at 10:33

2

Solved

I would like to get started with using libclang with Python. I am trying to get a sample code (http://www.altdevblogaday.com/2014/03/05/implementing-a-code-generator-with-libclang/) to work on Wind...
Chambertin asked 29/3, 2014 at 12:11

0

I'm trying to explore libclang (on Windows) to do "stuff*" based on parsing the AST. I find several examples, I'm unable to get anything to work. When I try to run this index = clang.cindex.Inde...
Colombia asked 3/4, 2018 at 19:30

2

Solved

I am learning to parse C++ files using Python + libclang with the help of this very informative (but slightly outdated) tutorial by Eli Bendersky. My objective is to parse C++ files and identify t...
Sabinesabino asked 17/4, 2017 at 22:24

2

Solved

I am writing a utility which is supposed to parse C++ (and C) header files, extract the structs, enums, fields etc. and generate code in other languages based on the extracted information. I decide...
Jamie asked 12/8, 2014 at 22:36

1

I have a software that is able to generate C code that I would like to use in a just-in-time compilation context. From what I understand, LLVM/Clang is the way to go and, for maintainability of the...
Bearden asked 27/8, 2015 at 16:27

1

I am trying to find (line and column position) all the references of a specific function declaration when parsing a C++ source file via libclang in Python. For example: #include <iostream> ...
Rauwolfia asked 12/5, 2016 at 18:24

1

Solved

I have some code (taken and adapted from here and here), which uses libclang to parse C++ sourcefiles in Python (Widnows) and get all of its declaration statements, as seen here: import clang.cind...
Teleutospore asked 8/5, 2016 at 10:23

2

Solved

libclang defines only 5 types of tokens: CXToken_Punctuation CXToken_Keyword CXToken_Identifier CXToken_Literal CXToken_Comment Is it possible to get a more detailed information about tokens? F...
Frontiersman asked 21/4, 2016 at 10:16

1

Solved

After some research and a few questions, I ended up exploring libclang library in order to parse C++ source files in Python. Given a C++ source int fac(int n) { return (n>1) ? n∗fac(n−1) : 1...
Chymotrypsin asked 23/4, 2016 at 8:40

1

Solved

Is there a way to detect anonymous enumerations using libclang without relying on the text in the spelling name? The python bindings to libclang include functionality to detect whether C/C++ stru...
Playreader asked 31/1, 2016 at 11:16

3

Solved

I've recently started using libclang to parse C files. The problem I'm having is that apparently, libclang initiates the preprocessor before generating AST. I would like to prohibit the preprocesso...
Cornea asked 14/12, 2012 at 15:22

© 2022 - 2025 — McMap. All rights reserved.