Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tessarin/cdecl
Translate any C declaration to plain English. Written using parsing algorithm by Peter van der Linden.
https://github.com/tessarin/cdecl
Last synced: about 17 hours ago
JSON representation
Translate any C declaration to plain English. Written using parsing algorithm by Peter van der Linden.
- Host: GitHub
- URL: https://github.com/tessarin/cdecl
- Owner: tessarin
- Created: 2017-10-01T14:12:58.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-10-02T01:59:46.000Z (about 7 years ago)
- Last Synced: 2024-10-25T08:18:55.290Z (21 days ago)
- Language: C
- Homepage:
- Size: 9.77 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cdecl - C Declarations Translator
`cdecl` translates C declarations to plain English.
Throughout the history of the C language, this program has been written many
times in different versions with varying levels of complexity and features.
This one in particular uses an algorithm developed by Peter van der Linden,
presented in his book *Expert C Programming*[1]. Writing the
program is given as an exercise in his book.## Installing
#### On macOS with [Homebrew][brw]
$ brew install tessarin/core/cdecl
#### Manual Installation
Run `make` to compile the program and generate the manual page. Then, move the
files to your desired and appropriate locations on your system:$ make
$ mv cdecl ~/bin
$ mv cdecl.1 ~/man/man1## Usage
Call `cdecl` passing the declaration or write it directly in your terminal.
The program will process the declaration and exit at the end of the first
line.$ cdecl
For more information including the types and features recognized by the
program check the [manual][man].## Examples
$ cdecl
long * const c
c is readonly pointer to long$ cdecl
int *(*fn())()
fn is function returning pointer to function returning pointer to int$ cdecl
short *(*(* const x)[3])()
x is readonly pointer to array with size 3 of pointer to function returning pointer to short---
[1] **Expert C Programming - Deep C Secrets**, 1st edition
Peter van der Linden
© 1994 Sun Microsystems, Inc.
ISBN 978-0-131-77429-2[brw]: https://brew.sh
[man]: cdecl.pod