Add Code Generator for idl_gen_fbs to parse .proto files (#7832)

* Add code generator for proto files

* Update

* Add --proto to script

* Remove cmt

* Move proto parsing logic into else block to share same set up logic for code_generator

* Remove IsValidCodeGenerator
This commit is contained in:
Khanh Nguyen
2023-03-02 10:01:44 -08:00
committed by GitHub
parent 6a9cd4411f
commit 4a34cd70dc
7 changed files with 119 additions and 16 deletions

View File

@@ -27,6 +27,7 @@
#include "idl_gen_cpp.h"
#include "idl_gen_csharp.h"
#include "idl_gen_dart.h"
#include "idl_gen_fbs.h"
#include "idl_gen_go.h"
#include "idl_gen_java.h"
#include "idl_gen_json_schema.h"
@@ -100,6 +101,11 @@ int main(int argc, const char *argv[]) {
"Generate Dart classes for tables/structs" },
flatbuffers::NewDartCodeGenerator());
flatc.RegisterCodeGenerator(
flatbuffers::FlatCOption{ "", "proto", "",
"Input is a .proto, translate to .fbs" },
flatbuffers::NewFBSCodeGenerator());
flatc.RegisterCodeGenerator(
flatbuffers::FlatCOption{ "g", "go", "",
"Generate Go files for tables/structs" },