sztomi / code-generator Goto Github PK
View Code? Open in Web Editor NEWContains the full source for my article about implementing a code generator with libclang.
License: MIT License
Contains the full source for my article about implementing a code generator with libclang.
License: MIT License
I had run ./build.sh and here is the output.
Building configurations...
Running action 'gmake'...
Generating Makefile...
Generating codegen.make...
Done.
==== Building codegen (debug) ====
textcomponent.h.bind.cc
Linking codegen
I got a test.py file in src/
When I launch test.py, I am getting below error.
python test.py
Traceback (most recent call last):
File "test.py", line 1, in
import CodegenExample
ImportError: No module named CodegenExample
there is no so file generated or atleast the step is missing.
can you tell what did I missed?
I am very much interested in this automatic python generator and would like to apply this onto a large c++ library. I should also mention there is a heavy use of template in the target library.
I wanted to extend dump_ast to print out the names and types of the arguments to functions.
For example, consider the following test.h file:
SomeType foo (AnotherType a, AnotherType b);
Lets suppose SomeType and AnotherType could be defined in another header file.
Currently running dump_ast.h returns the following:
./dump_ast.py test.h
TRANSLATION_UNIT test.h
+--TYPEDEF_DECL __int128_t
+--TYPEDEF_DECL __uint128_t
+--TYPEDEF_DECL __builtin_va_list
| +--TYPE_REF __va_list_tag
+--FUNCTION_DECL foo
There is no real useful information about foo here, I would like to know that it receives two parameters named a and b of type AnotherType
, and that it returns a parameter of SomeType
. I would like to think this should be possible using the clang api, unfortunately I haven't been able to do this.
By using the get_arguments()
(as opposed to only get_children()
) I am able to get the names of the input parameters of a function, but I can't get the names of their types. Suggestions?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.