--- /dev/null
+// Protocol Buffers - Google's data interchange format\r
+// Copyright 2008 Google Inc. All rights reserved.\r
+// http://code.google.com/p/protobuf/\r
+//\r
+// Redistribution and use in source and binary forms, with or without\r
+// modification, are permitted provided that the following conditions are\r
+// met:\r
+//\r
+// * Redistributions of source code must retain the above copyright\r
+// notice, this list of conditions and the following disclaimer.\r
+// * Redistributions in binary form must reproduce the above\r
+// copyright notice, this list of conditions and the following disclaimer\r
+// in the documentation and/or other materials provided with the\r
+// distribution.\r
+// * Neither the name of Google Inc. nor the names of its\r
+// contributors may be used to endorse or promote products derived from\r
+// this software without specific prior written permission.\r
+//\r
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+// Author: kenton@google.com (Kenton Varda)\r
+// Based on original Protocol Buffers design by\r
+// Sanjay Ghemawat, Jeff Dean, and others.\r
+//\r
+// The messages in this file describe the definitions found in .proto files.\r
+// A valid .proto file can be translated directly to a FileDescriptorProto\r
+// without any other information (e.g. without reading its imports).\r
+\r
+\r
+\r
+package google.protobuf;\r
+option java_package = "com.google.protobuf";\r
+option java_outer_classname = "DescriptorProtos";\r
+\r
+// descriptor.proto must be optimized for speed because reflection-based\r
+// algorithms don't work during bootstrapping.\r
+option optimize_for = SPEED;\r
+\r
+// The protocol compiler can output a FileDescriptorSet containing the .proto\r
+// files it parses.\r
+message FileDescriptorSet {\r
+ repeated FileDescriptorProto file = 1;\r
+}\r
+\r
+// Describes a complete .proto file.\r
+message FileDescriptorProto {\r
+ optional string name = 1; // file name, relative to root of source tree\r
+ optional string package = 2; // e.g. "foo", "foo.bar", etc.\r
+\r
+ // Names of files imported by this file.\r
+ repeated string dependency = 3;\r
+ // Indexes of the public imported files in the dependency list above.\r
+ repeated int32 public_dependency = 10;\r
+ // Indexes of the weak imported files in the dependency list.\r
+ // For Google-internal migration only. Do not use.\r
+ repeated int32 weak_dependency = 11;\r
+\r
+ // All top-level definitions in this file.\r
+ repeated DescriptorProto message_type = 4;\r
+ repeated EnumDescriptorProto enum_type = 5;\r
+ repeated ServiceDescriptorProto service = 6;\r
+ repeated FieldDescriptorProto extension = 7;\r
+\r
+ optional FileOptions options = 8;\r
+\r
+ // This field contains optional information about the original source code.\r
+ // You may safely remove this entire field whithout harming runtime\r
+ // functionality of the descriptors -- the information is needed only by\r
+ // development tools.\r
+ optional SourceCodeInfo source_code_info = 9;\r
+}\r
+\r
+// Describes a message type.\r
+message DescriptorProto {\r
+ optional string name = 1;\r
+\r
+ repeated FieldDescriptorProto field = 2;\r
+ repeated FieldDescriptorProto extension = 6;\r
+\r
+ repeated DescriptorProto nested_type = 3;\r
+ repeated EnumDescriptorProto enum_type = 4;\r
+\r
+ message ExtensionRange {\r
+ optional int32 start = 1;\r
+ optional int32 end = 2;\r
+ }\r
+ repeated ExtensionRange extension_range = 5;\r
+\r
+ optional MessageOptions options = 7;\r
+}\r
+\r
+// Describes a field within a message.\r
+message FieldDescriptorProto {\r
+ enum Type {\r
+ // 0 is reserved for errors.\r
+ // Order is weird for historical reasons.\r
+ TYPE_DOUBLE = 1;\r
+ TYPE_FLOAT = 2;\r
+ // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if\r
+ // negative values are likely.\r
+ TYPE_INT64 = 3;\r
+ TYPE_UINT64 = 4;\r
+ // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if\r
+ // negative values are likely.\r
+ TYPE_INT32 = 5;\r
+ TYPE_FIXED64 = 6;\r
+ TYPE_FIXED32 = 7;\r
+ TYPE_BOOL = 8;\r
+ TYPE_STRING = 9;\r
+ TYPE_GROUP = 10; // Tag-delimited aggregate.\r
+ TYPE_MESSAGE = 11; // Length-delimited aggregate.\r
+\r
+ // New in version 2.\r
+ TYPE_BYTES = 12;\r
+ TYPE_UINT32 = 13;\r
+ TYPE_ENUM = 14;\r
+ TYPE_SFIXED32 = 15;\r
+ TYPE_SFIXED64 = 16;\r
+ TYPE_SINT32 = 17; // Uses ZigZag encoding.\r
+ TYPE_SINT64 = 18; // Uses ZigZag encoding.\r
+ };\r
+\r
+ enum Label {\r
+ // 0 is reserved for errors\r
+ LABEL_OPTIONAL = 1;\r
+ LABEL_REQUIRED = 2;\r
+ LABEL_REPEATED = 3;\r
+ // TODO(sanjay): Should we add LABEL_MAP?\r
+ };\r
+\r
+ optional string name = 1;\r
+ optional int32 number = 3;\r
+ optional Label label = 4;\r
+\r
+ // If type_name is set, this need not be set. If both this and type_name\r
+ // are set, this must be either TYPE_ENUM or TYPE_MESSAGE.\r
+ optional Type type = 5;\r
+\r
+ // For message and enum types, this is the name of the type. If the name\r
+ // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping\r
+ // rules are used to find the type (i.e. first the nested types within this\r
+ // message are searched, then within the parent, on up to the root\r
+ // namespace).\r
+ optional string type_name = 6;\r
+\r
+ // For extensions, this is the name of the type being extended. It is\r
+ // resolved in the same manner as type_name.\r
+ optional string extendee = 2;\r
+\r
+ // For numeric types, contains the original text representation of the value.\r
+ // For booleans, "true" or "false".\r
+ // For strings, contains the default text contents (not escaped in any way).\r
+ // For bytes, contains the C escaped value. All bytes >= 128 are escaped.\r
+ // TODO(kenton): Base-64 encode?\r
+ optional string default_value = 7;\r
+\r
+ optional FieldOptions options = 8;\r
+}\r
+\r
+// Describes an enum type.\r
+message EnumDescriptorProto {\r
+ optional string name = 1;\r
+\r
+ repeated EnumValueDescriptorProto value = 2;\r
+\r
+ optional EnumOptions options = 3;\r
+}\r
+\r
+// Describes a value within an enum.\r
+message EnumValueDescriptorProto {\r
+ optional string name = 1;\r
+ optional int32 number = 2;\r
+\r
+ optional EnumValueOptions options = 3;\r
+}\r
+\r
+// Describes a service.\r
+message ServiceDescriptorProto {\r
+ optional string name = 1;\r
+ repeated MethodDescriptorProto method = 2;\r
+\r
+ optional ServiceOptions options = 3;\r
+}\r
+\r
+// Describes a method of a service.\r
+message MethodDescriptorProto {\r
+ optional string name = 1;\r
+\r
+ // Input and output type names. These are resolved in the same way as\r
+ // FieldDescriptorProto.type_name, but must refer to a message type.\r
+ optional string input_type = 2;\r
+ optional string output_type = 3;\r
+\r
+ optional MethodOptions options = 4;\r
+}\r
+\r
+\r
+// ===================================================================\r
+// Options\r
+\r
+// Each of the definitions above may have "options" attached. These are\r
+// just annotations which may cause code to be generated slightly differently\r
+// or may contain hints for code that manipulates protocol messages.\r
+//\r
+// Clients may define custom options as extensions of the *Options messages.\r
+// These extensions may not yet be known at parsing time, so the parser cannot\r
+// store the values in them. Instead it stores them in a field in the *Options\r
+// message called uninterpreted_option. This field must have the same name\r
+// across all *Options messages. We then use this field to populate the\r
+// extensions when we build a descriptor, at which point all protos have been\r
+// parsed and so all extensions are known.\r
+//\r
+// Extension numbers for custom options may be chosen as follows:\r
+// * For options which will only be used within a single application or\r
+// organization, or for experimental options, use field numbers 50000\r
+// through 99999. It is up to you to ensure that you do not use the\r
+// same number for multiple options.\r
+// * For options which will be published and used publicly by multiple\r
+// independent entities, e-mail protobuf-global-extension-registry@google.com\r
+// to reserve extension numbers. Simply provide your project name (e.g.\r
+// Object-C plugin) and your porject website (if available) -- there's no need\r
+// to explain how you intend to use them. Usually you only need one extension\r
+// number. You can declare multiple options with only one extension number by\r
+// putting them in a sub-message. See the Custom Options section of the docs\r
+// for examples:\r
+// http://code.google.com/apis/protocolbuffers/docs/proto.html#options\r
+// If this turns out to be popular, a web service will be set up\r
+// to automatically assign option numbers.\r
+\r
+\r
+message FileOptions {\r
+\r
+ // Sets the Java package where classes generated from this .proto will be\r
+ // placed. By default, the proto package is used, but this is often\r
+ // inappropriate because proto packages do not normally start with backwards\r
+ // domain names.\r
+ optional string java_package = 1;\r
+\r
+\r
+ // If set, all the classes from the .proto file are wrapped in a single\r
+ // outer class with the given name. This applies to both Proto1\r
+ // (equivalent to the old "--one_java_file" option) and Proto2 (where\r
+ // a .proto always translates to a single class, but you may want to\r
+ // explicitly choose the class name).\r
+ optional string java_outer_classname = 8;\r
+\r
+ // If set true, then the Java code generator will generate a separate .java\r
+ // file for each top-level message, enum, and service defined in the .proto\r
+ // file. Thus, these types will *not* be nested inside the outer class\r
+ // named by java_outer_classname. However, the outer class will still be\r
+ // generated to contain the file's getDescriptor() method as well as any\r
+ // top-level extensions defined in the file.\r
+ optional bool java_multiple_files = 10 [default=false];\r
+\r
+ // If set true, then the Java code generator will generate equals() and\r
+ // hashCode() methods for all messages defined in the .proto file. This is\r
+ // purely a speed optimization, as the AbstractMessage base class includes\r
+ // reflection-based implementations of these methods.\r
+ optional bool java_generate_equals_and_hash = 20 [default=false];\r
+\r
+ // Generated classes can be optimized for speed or code size.\r
+ enum OptimizeMode {\r
+ SPEED = 1; // Generate complete code for parsing, serialization,\r
+ // etc.\r
+ CODE_SIZE = 2; // Use ReflectionOps to implement these methods.\r
+ LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime.\r
+ }\r
+ optional OptimizeMode optimize_for = 9 [default=SPEED];\r
+\r
+ // Sets the Go package where structs generated from this .proto will be\r
+ // placed. There is no default.\r
+ optional string go_package = 11;\r
+\r
+\r
+\r
+ // Should generic services be generated in each language? "Generic" services\r
+ // are not specific to any particular RPC system. They are generated by the\r
+ // main code generators in each language (without additional plugins).\r
+ // Generic services were the only kind of service generation supported by\r
+ // early versions of proto2.\r
+ //\r
+ // Generic services are now considered deprecated in favor of using plugins\r
+ // that generate code specific to your particular RPC system. Therefore,\r
+ // these default to false. Old code which depends on generic services should\r
+ // explicitly set them to true.\r
+ optional bool cc_generic_services = 16 [default=false];\r
+ optional bool java_generic_services = 17 [default=false];\r
+ optional bool py_generic_services = 18 [default=false];\r
+\r
+ // The parser stores options it doesn't recognize here. See above.\r
+ repeated UninterpretedOption uninterpreted_option = 999;\r
+\r
+ // Clients can define custom options in extensions of this message. See above.\r
+ extensions 1000 to max;\r
+}\r
+\r
+message MessageOptions {\r
+ // Set true to use the old proto1 MessageSet wire format for extensions.\r
+ // This is provided for backwards-compatibility with the MessageSet wire\r
+ // format. You should not use this for any other reason: It's less\r
+ // efficient, has fewer features, and is more complicated.\r
+ //\r
+ // The message must be defined exactly as follows:\r
+ // message Foo {\r
+ // option message_set_wire_format = true;\r
+ // extensions 4 to max;\r
+ // }\r
+ // Note that the message cannot have any defined fields; MessageSets only\r
+ // have extensions.\r
+ //\r
+ // All extensions of your type must be singular messages; e.g. they cannot\r
+ // be int32s, enums, or repeated messages.\r
+ //\r
+ // Because this is an option, the above two restrictions are not enforced by\r
+ // the protocol compiler.\r
+ optional bool message_set_wire_format = 1 [default=false];\r
+\r
+ // Disables the generation of the standard "descriptor()" accessor, which can\r
+ // conflict with a field of the same name. This is meant to make migration\r
+ // from proto1 easier; new code should avoid fields named "descriptor".\r
+ optional bool no_standard_descriptor_accessor = 2 [default=false];\r
+\r
+ // The parser stores options it doesn't recognize here. See above.\r
+ repeated UninterpretedOption uninterpreted_option = 999;\r
+\r
+ // Clients can define custom options in extensions of this message. See above.\r
+ extensions 1000 to max;\r
+}\r
+\r
+message FieldOptions {\r
+ // The ctype option instructs the C++ code generator to use a different\r
+ // representation of the field than it normally would. See the specific\r
+ // options below. This option is not yet implemented in the open source\r
+ // release -- sorry, we'll try to include it in a future version!\r
+ optional CType ctype = 1 [default = STRING];\r
+ enum CType {\r
+ // Default mode.\r
+ STRING = 0;\r
+\r
+ CORD = 1;\r
+\r
+ STRING_PIECE = 2;\r
+ }\r
+ // The packed option can be enabled for repeated primitive fields to enable\r
+ // a more efficient representation on the wire. Rather than repeatedly\r
+ // writing the tag and type for each element, the entire array is encoded as\r
+ // a single length-delimited blob.\r
+ optional bool packed = 2;\r
+\r
+\r
+\r
+ // Should this field be parsed lazily? Lazy applies only to message-type\r
+ // fields. It means that when the outer message is initially parsed, the\r
+ // inner message's contents will not be parsed but instead stored in encoded\r
+ // form. The inner message will actually be parsed when it is first accessed.\r
+ //\r
+ // This is only a hint. Implementations are free to choose whether to use\r
+ // eager or lazy parsing regardless of the value of this option. However,\r
+ // setting this option true suggests that the protocol author believes that\r
+ // using lazy parsing on this field is worth the additional bookkeeping\r
+ // overhead typically needed to implement it.\r
+ //\r
+ // This option does not affect the public interface of any generated code;\r
+ // all method signatures remain the same. Furthermore, thread-safety of the\r
+ // interface is not affected by this option; const methods remain safe to\r
+ // call from multiple threads concurrently, while non-const methods continue\r
+ // to require exclusive access.\r
+ //\r
+ //\r
+ // Note that implementations may choose not to check required fields within\r
+ // a lazy sub-message. That is, calling IsInitialized() on the outher message\r
+ // may return true even if the inner message has missing required fields.\r
+ // This is necessary because otherwise the inner message would have to be\r
+ // parsed in order to perform the check, defeating the purpose of lazy\r
+ // parsing. An implementation which chooses not to check required fields\r
+ // must be consistent about it. That is, for any particular sub-message, the\r
+ // implementation must either *always* check its required fields, or *never*\r
+ // check its required fields, regardless of whether or not the message has\r
+ // been parsed.\r
+ optional bool lazy = 5 [default=false];\r
+\r
+ // Is this field deprecated?\r
+ // Depending on the target platform, this can emit Deprecated annotations\r
+ // for accessors, or it will be completely ignored; in the very least, this\r
+ // is a formalization for deprecating fields.\r
+ optional bool deprecated = 3 [default=false];\r
+\r
+ // EXPERIMENTAL. DO NOT USE.\r
+ // For "map" fields, the name of the field in the enclosed type that\r
+ // is the key for this map. For example, suppose we have:\r
+ // message Item {\r
+ // required string name = 1;\r
+ // required string value = 2;\r
+ // }\r
+ // message Config {\r
+ // repeated Item items = 1 [experimental_map_key="name"];\r
+ // }\r
+ // In this situation, the map key for Item will be set to "name".\r
+ // TODO: Fully-implement this, then remove the "experimental_" prefix.\r
+ optional string experimental_map_key = 9;\r
+\r
+ // For Google-internal migration only. Do not use.\r
+ optional bool weak = 10 [default=false];\r
+\r
+ // The parser stores options it doesn't recognize here. See above.\r
+ repeated UninterpretedOption uninterpreted_option = 999;\r
+\r
+ // Clients can define custom options in extensions of this message. See above.\r
+ extensions 1000 to max;\r
+}\r
+\r
+message EnumOptions {\r
+\r
+ // Set this option to false to disallow mapping different tag names to a same\r
+ // value.\r
+ optional bool allow_alias = 2 [default=true];\r
+\r
+ // The parser stores options it doesn't recognize here. See above.\r
+ repeated UninterpretedOption uninterpreted_option = 999;\r
+\r
+ // Clients can define custom options in extensions of this message. See above.\r
+ extensions 1000 to max;\r
+}\r
+\r
+message EnumValueOptions {\r
+ // The parser stores options it doesn't recognize here. See above.\r
+ repeated UninterpretedOption uninterpreted_option = 999;\r
+\r
+ // Clients can define custom options in extensions of this message. See above.\r
+ extensions 1000 to max;\r
+}\r
+\r
+message ServiceOptions {\r
+\r
+ // Note: Field numbers 1 through 32 are reserved for Google's internal RPC\r
+ // framework. We apologize for hoarding these numbers to ourselves, but\r
+ // we were already using them long before we decided to release Protocol\r
+ // Buffers.\r
+\r
+ // The parser stores options it doesn't recognize here. See above.\r
+ repeated UninterpretedOption uninterpreted_option = 999;\r
+\r
+ // Clients can define custom options in extensions of this message. See above.\r
+ extensions 1000 to max;\r
+}\r
+\r
+message MethodOptions {\r
+\r
+ // Note: Field numbers 1 through 32 are reserved for Google's internal RPC\r
+ // framework. We apologize for hoarding these numbers to ourselves, but\r
+ // we were already using them long before we decided to release Protocol\r
+ // Buffers.\r
+\r
+ // The parser stores options it doesn't recognize here. See above.\r
+ repeated UninterpretedOption uninterpreted_option = 999;\r
+\r
+ // Clients can define custom options in extensions of this message. See above.\r
+ extensions 1000 to max;\r
+}\r
+\r
+\r
+// A message representing a option the parser does not recognize. This only\r
+// appears in options protos created by the compiler::Parser class.\r
+// DescriptorPool resolves these when building Descriptor objects. Therefore,\r
+// options protos in descriptor objects (e.g. returned by Descriptor::options(),\r
+// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions\r
+// in them.\r
+message UninterpretedOption {\r
+ // The name of the uninterpreted option. Each string represents a segment in\r
+ // a dot-separated name. is_extension is true iff a segment represents an\r
+ // extension (denoted with parentheses in options specs in .proto files).\r
+ // E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents\r
+ // "foo.(bar.baz).qux".\r
+ message NamePart {\r
+ required string name_part = 1;\r
+ required bool is_extension = 2;\r
+ }\r
+ repeated NamePart name = 2;\r
+\r
+ // The value of the uninterpreted option, in whatever type the tokenizer\r
+ // identified it as during parsing. Exactly one of these should be set.\r
+ optional string identifier_value = 3;\r
+ optional uint64 positive_int_value = 4;\r
+ optional int64 negative_int_value = 5;\r
+ optional double double_value = 6;\r
+ optional bytes string_value = 7;\r
+ optional string aggregate_value = 8;\r
+}\r
+\r
+// ===================================================================\r
+// Optional source code info\r
+\r
+// Encapsulates information about the original source file from which a\r
+// FileDescriptorProto was generated.\r
+message SourceCodeInfo {\r
+ // A Location identifies a piece of source code in a .proto file which\r
+ // corresponds to a particular definition. This information is intended\r
+ // to be useful to IDEs, code indexers, documentation generators, and similar\r
+ // tools.\r
+ //\r
+ // For example, say we have a file like:\r
+ // message Foo {\r
+ // optional string foo = 1;\r
+ // }\r
+ // Let's look at just the field definition:\r
+ // optional string foo = 1;\r
+ // ^ ^^ ^^ ^ ^^^\r
+ // a bc de f ghi\r
+ // We have the following locations:\r
+ // span path represents\r
+ // [a,i) [ 4, 0, 2, 0 ] The whole field definition.\r
+ // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional).\r
+ // [c,d) [ 4, 0, 2, 0, 5 ] The type (string).\r
+ // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo).\r
+ // [g,h) [ 4, 0, 2, 0, 3 ] The number (1).\r
+ //\r
+ // Notes:\r
+ // - A location may refer to a repeated field itself (i.e. not to any\r
+ // particular index within it). This is used whenever a set of elements are\r
+ // logically enclosed in a single code segment. For example, an entire\r
+ // extend block (possibly containing multiple extension definitions) will\r
+ // have an outer location whose path refers to the "extensions" repeated\r
+ // field without an index.\r
+ // - Multiple locations may have the same path. This happens when a single\r
+ // logical declaration is spread out across multiple places. The most\r
+ // obvious example is the "extend" block again -- there may be multiple\r
+ // extend blocks in the same scope, each of which will have the same path.\r
+ // - A location's span is not always a subset of its parent's span. For\r
+ // example, the "extendee" of an extension declaration appears at the\r
+ // beginning of the "extend" block and is shared by all extensions within\r
+ // the block.\r
+ // - Just because a location's span is a subset of some other location's span\r
+ // does not mean that it is a descendent. For example, a "group" defines\r
+ // both a type and a field in a single declaration. Thus, the locations\r
+ // corresponding to the type and field and their components will overlap.\r
+ // - Code which tries to interpret locations should probably be designed to\r
+ // ignore those that it doesn't understand, as more types of locations could\r
+ // be recorded in the future.\r
+ repeated Location location = 1;\r
+ message Location {\r
+ // Identifies which part of the FileDescriptorProto was defined at this\r
+ // location.\r
+ //\r
+ // Each element is a field number or an index. They form a path from\r
+ // the root FileDescriptorProto to the place where the definition. For\r
+ // example, this path:\r
+ // [ 4, 3, 2, 7, 1 ]\r
+ // refers to:\r
+ // file.message_type(3) // 4, 3\r
+ // .field(7) // 2, 7\r
+ // .name() // 1\r
+ // This is because FileDescriptorProto.message_type has field number 4:\r
+ // repeated DescriptorProto message_type = 4;\r
+ // and DescriptorProto.field has field number 2:\r
+ // repeated FieldDescriptorProto field = 2;\r
+ // and FieldDescriptorProto.name has field number 1:\r
+ // optional string name = 1;\r
+ //\r
+ // Thus, the above path gives the location of a field name. If we removed\r
+ // the last element:\r
+ // [ 4, 3, 2, 7 ]\r
+ // this path refers to the whole field declaration (from the beginning\r
+ // of the label to the terminating semicolon).\r
+ repeated int32 path = 1 [packed=true];\r
+\r
+ // Always has exactly three or four elements: start line, start column,\r
+ // end line (optional, otherwise assumed same as start line), end column.\r
+ // These are packed into a single field for efficiency. Note that line\r
+ // and column numbers are zero-based -- typically you will want to add\r
+ // 1 to each before displaying to a user.\r
+ repeated int32 span = 2 [packed=true];\r
+\r
+ // If this SourceCodeInfo represents a complete declaration, these are any\r
+ // comments appearing before and after the declaration which appear to be\r
+ // attached to the declaration.\r
+ //\r
+ // A series of line comments appearing on consecutive lines, with no other\r
+ // tokens appearing on those lines, will be treated as a single comment.\r
+ //\r
+ // Only the comment content is provided; comment markers (e.g. //) are\r
+ // stripped out. For block comments, leading whitespace and an asterisk\r
+ // will be stripped from the beginning of each line other than the first.\r
+ // Newlines are included in the output.\r
+ //\r
+ // Examples:\r
+ //\r
+ // optional int32 foo = 1; // Comment attached to foo.\r
+ // // Comment attached to bar.\r
+ // optional int32 bar = 2;\r
+ //\r
+ // optional string baz = 3;\r
+ // // Comment attached to baz.\r
+ // // Another line attached to baz.\r
+ //\r
+ // // Comment attached to qux.\r
+ // //\r
+ // // Another line attached to qux.\r
+ // optional double qux = 4;\r
+ //\r
+ // optional string corge = 5;\r
+ // /* Block comment attached\r
+ // * to corge. Leading asterisks\r
+ // * will be removed. */\r
+ // /* Block comment attached to\r
+ // * grault. */\r
+ // optional int32 grault = 6;\r
+ optional string leading_comments = 3;\r
+ optional string trailing_comments = 4;\r
+ }\r
+}\r