Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fish2000/iod-symbolizer
Parse C/C++/Objective-C/Objective-C++ source for IOD symbols and output header files
https://github.com/fish2000/iod-symbolizer
cmake command-line-tool cplusplus-14 iod iod-symbols preprocessor python
Last synced: 4 months ago
JSON representation
Parse C/C++/Objective-C/Objective-C++ source for IOD symbols and output header files
- Host: GitHub
- URL: https://github.com/fish2000/iod-symbolizer
- Owner: fish2000
- Created: 2015-05-24T09:05:38.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-10-15T19:36:35.000Z (over 8 years ago)
- Last Synced: 2024-10-05T00:29:01.899Z (4 months ago)
- Topics: cmake, command-line-tool, cplusplus-14, iod, iod-symbols, preprocessor, python
- Language: Python
- Size: 33.2 KB
- Stars: 4
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
iod-symbolizer
==============A parser for [IOD symbols](https://github.com/matt-42/iod), in C/C++/Objective-C/Objective-C++ source files. Given the following input:
```c++
// Copyright 2012-2014 Alexander Böhn
// License: MIT (see COPYING.MIT file)#ifndef LIBIMREAD_IO_PNG_HH_
#define LIBIMREAD_IO_PNG_HH_#include
#include
#include
#include#include
#include
#includenamespace im {
/*
using namespace symbols::s;
auto options =
D(
_compression_level = -1,
_backend = "io_png"
);
*/
namespace PNG {
struct format {
static auto opts_init() {
return D(
_signature = "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A"
);
}
using options_type = decltype(format::opts_init());
static const options_type options;
};
}
#define PNG_SIGNATURE "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A"
// namespace signature {
// struct PNGSignature {
// PNGSignature() {}
// operator char const*() { return "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A"; }
// };
// static const PNGSignature PNG;
// }
class PNGFormat : public ImageFormat {
public:
typedef std::true_type can_read;
typedef std::true_type can_write;
/// NOT AN OVERRIDE:
static bool match_format(byte_source *src) {
return match_magic(src, PNG_SIGNATURE, 8);
}
virtual std::unique_ptr read(byte_source *src,
ImageFactory *factory,
const options_map &opts) override;
virtual void write(Image &input,
byte_sink *output,
const options_map &opts) override;
};
namespace format {
using PNG = PNGFormat;
}}
#endif /// LIBIMREAD_IO_PNG_HH_
```... the `symbolizer` command will find the following symbols:
```c++
_compression_level
_backend
_signature
```And by default, the generated header file will look like so:
```c++
///
/// Generated by iod-symbolizer at 2015-05-24T05:02:20.448982
/// iod-symbolizer by Alexander Bohn -- http://github.com/fish2000/iod-symbolizer
/// IOD library by Matthieu Garrigues -- https://github.com/matt-42/iod
///#include
#ifndef IOD_SYMBOL_assert
#define IOD_SYMBOL_assert
iod_define_symbol(assert)
#endif#ifndef IOD_SYMBOL_color_map
#define IOD_SYMBOL_color_map
iod_define_symbol(color_map)
#endif#ifndef IOD_SYMBOL_compression_level
#define IOD_SYMBOL_compression_level
iod_define_symbol(compression_level)
#endif#ifndef IOD_SYMBOL_x_
#define IOD_SYMBOL_x_
iod_define_symbol(x_)
#endif#ifndef IOD_SYMBOL_signature
#define IOD_SYMBOL_signature
iod_define_symbol(signature)
#endif#ifndef IOD_SYMBOL_fd
#define IOD_SYMBOL_fd
iod_define_symbol(fd)
#endif#ifndef IOD_SYMBOL_pitch
#define IOD_SYMBOL_pitch
iod_define_symbol(pitch)
#endif#ifndef IOD_SYMBOL_backend
#define IOD_SYMBOL_backend
iod_define_symbol(backend)
#endif
```By default, the generated header is written to STDOUT. Run the symbolizer like so to write to a specific file:
```bash
$ symbolizer DIR0 DIR1 DIR2 -o symbols.hh
```Install
-------Install with Pip, via PyPI:
```bash
$ pip install -U iod-symbolizer
```… Or via GitHub:
```bash
$ git clone https://github.com/fish2000/iod-symbolizer.git
$ cd iod-symbolizer
$ pip install -U -r requirements.txt
$ pip install -U .
```Questions?
----------Contact me, I welcome all inquiries: fish2000, at the geemail, etc etc. I am also available for hire!