Show HN: Cdecl-dump - represent C declarations visually (github.com)
A small tool that parses C declarations and outputs a simple visual representation at each stage, as it encounters arrays, pointers or functions.
The program uses a table-driven lexer and a hand-written, shift-reduce parser. No external dependencies apart from the standard library.
3 comments
[ 3.7 ms ] story [ 20.1 ms ] threadTL;DR: you declare a variable in C _in exactly the same way you would use it:_ if you know how to use a variable, then you know how to read and write a declaration for it.
https://eigenstate.org/notes/c-decl https://news.ycombinator.com/item?id=12775966
P.S. Please add a license for your code.
[1] https://tree-sitter.github.io/
[2] https://github.com/rizinorg/rizin/tree/dev/librz/type/parser
[3] https://github.com/rizinorg/rizin-grammar-c/
[4] https://github.com/tree-sitter/tree-sitter/issues/711