MCPcopy Create free account
hub / github.com/catboost/catboost / GetConformParser

Method GetConformParser

contrib/libs/flatbuffers/src/flatc.cpp:727–751  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

725}
726
727flatbuffers::Parser FlatCompiler::GetConformParser(
728 const FlatCOptions &options) {
729 flatbuffers::Parser conform_parser;
730
731 // conform parser should check advanced options,
732 // so, it have to have knowledge about languages:
733 conform_parser.opts.lang_to_generate = options.opts.lang_to_generate;
734
735 if (!options.conform_to_schema.empty()) {
736 std::string contents;
737 if (!flatbuffers::LoadFile(options.conform_to_schema.c_str(), true,
738 &contents)) {
739 Error("unable to load schema: " + options.conform_to_schema);
740 }
741
742 if (flatbuffers::GetExtension(options.conform_to_schema) ==
743 reflection::SchemaExtension()) {
744 LoadBinarySchema(conform_parser, options.conform_to_schema, contents);
745 } else {
746 ParseFile(conform_parser, options.conform_to_schema, contents,
747 options.conform_include_directories);
748 }
749 }
750 return conform_parser;
751}
752
753std::unique_ptr<Parser> FlatCompiler::GenerateCode(const FlatCOptions &options,
754 Parser &conform_parser) {

Callers

nothing calls this directly

Calls 6

LoadFileFunction · 0.85
SchemaExtensionFunction · 0.85
ErrorFunction · 0.70
GetExtensionFunction · 0.70
emptyMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected