https://github.com/mprot/mprotc
An mprot compiler to translate schema definitions into source code.
https://github.com/mprot/mprotc
compiler messagepack mprot msgpack
Last synced: 9 months ago
JSON representation
An mprot compiler to translate schema definitions into source code.
- Host: GitHub
- URL: https://github.com/mprot/mprotc
- Owner: mprot
- License: mit
- Created: 2017-09-26T05:35:30.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-01-23T10:23:11.000Z (over 2 years ago)
- Last Synced: 2025-03-12T15:18:39.714Z (over 1 year ago)
- Topics: compiler, messagepack, mprot, msgpack
- Language: Go
- Homepage:
- Size: 108 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mprotc
`mprotc` is a compiler for [mprot](https://github.com/mprot/mprot) to translate schema definitions into source code.
## Usage
```
Synopsis:
mprotc [options] [schema-file ...]
mprotc help
Description:
The mprotc tool compiles schema definition files into source code of the specified programming language.
The following options are available:
--root
Specify the root path for the schema files. The given schema files are interpreted relative to this
directory. The default is the current directory.
--out
Specify the output path for the generated code. The default is the current directory.
--deprecated
Include the deprecated fields in the generated code.
--dryrun
Print the names of generated files only instead of writing the files.
```
## Supported Languages
* [Golang](internal/gen/golang/README.md):
```
mprotc go [options] [schema-file ...]
Additional Options:
--import-root
Import root path for all schema imports. The default is the path specified by the output directory.
--scoped-enums
Scope the enumerators of the generated enums, i.e. prefix the enumerator names with the enum name.
The default is false.
--unwrap-union
Unwrap the union types of the generated struct fields, i.e. use an empty interface as the field type.
The default is false.
```
* [JavaScript/TypeScript](internal/gen/js/README.md):
```
mprotc js [options] [schema-file ...]
Additional Options:
--typedecls
Generate type declarations in a separate .d.ts file. This flag should be used to generate TypeScript
instead of JavaScript. The default is false.
```