Final refactor for bfsb_generator* and text generator (#7806)

* Refactor BfbsGenerator to use CodeGenerator interface

* Update

* Refactor bfbs generator

* Refactor bfbs generator for lua and nim. Remove old code that use Generator
interface.

* Update import

* Update CMakeLists

* Update BUILD file

* Update BUILD file for src

* Remove from Android CMakeLists and add error message

* Update

* Add generate root file function to Code Generator interface

* Update

* Update

* Minor format fix
This commit is contained in:
Khanh Nguyen
2023-01-31 09:35:34 -08:00
committed by GitHub
parent a6f4194489
commit 08ebd202e2
30 changed files with 357 additions and 222 deletions

View File

@@ -32,7 +32,8 @@ class CodeGenerator {
enum Status {
OK = 0,
ERROR = 1,
NOT_IMPLEMENTED = 2,
FAILED_VERIFICATION = 2,
NOT_IMPLEMENTED = 3
};
// Generate code from the provided `parser`.
@@ -52,11 +53,17 @@ class CodeGenerator {
virtual Status GenerateGrpcCode(const Parser &parser, const std::string &path,
const std::string &filename) = 0;
virtual Status GenerateRootFile(const Parser &parser,
const std::string &path) = 0;
virtual bool IsSchemaOnly() const = 0;
virtual bool SupportsBfbsGeneration() const = 0;
virtual bool SupportsRootFileGeneration() const = 0;
virtual IDLOptions::Language Language() const = 0;
virtual std::string LanguageName() const = 0;
protected: