cdecl-blocks | The venerable cdecl , with Apple blocks support | Translation library
kandi X-RAY | cdecl-blocks Summary
kandi X-RAY | cdecl-blocks Summary
This is cdecl, the C gibberish translator. This version has been enhanced by ridiculous_fish to support Apple's blocks syntax. Visit to use it online. Cdecl is a program which will turn English-like phrases such as "declare foo as array 5 of pointer to function returning int" into C declarations such as "int (*foo[5])()". It can also translate the C into the pseudo- English. And it handles typecasts, too. Plus C++. And in this version it has command line editing and history with the GNU readline library.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of cdecl-blocks
cdecl-blocks Key Features
cdecl-blocks Examples and Code Snippets
Community Discussions
Trending Discussions on cdecl-blocks
QUESTION
Much has been written on the topic of how to parse C declarations.
I need to do the reverse: Take a tree representation of a type, together with the variable name, and print out a corresponding declaration as it would appear in C source code.
Has anyone written down an algorithm for doing this, in available form?
(I tried looking at https://github.com/ridiculousfish/cdecl-blocks which seems as though it must contain such a thing, but I have been able to find in it, code for doing everything related to its functionality except generating C declarations.)
...ANSWER
Answered 2019-Jul-26 at 21:24Eli Bendersky's Python library pycparser has an example, parsing C-code to an AST-representation, and pretty-prints it, converting it to C-code again.
The specific example I am thinking of can be found here, and the part I think is of interest to you, is this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install cdecl-blocks
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page