• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Protocol Buffers - Google's data interchange format
2// Copyright 2008 Google Inc.  All rights reserved.
3// https://developers.google.com/protocol-buffers/
4//
5// Redistribution and use in source and binary forms, with or without
6// modification, are permitted provided that the following conditions are
7// met:
8//
9//     * Redistributions of source code must retain the above copyright
10// notice, this list of conditions and the following disclaimer.
11//     * Redistributions in binary form must reproduce the above
12// copyright notice, this list of conditions and the following disclaimer
13// in the documentation and/or other materials provided with the
14// distribution.
15//     * Neither the name of Google Inc. nor the names of its
16// contributors may be used to endorse or promote products derived from
17// this software without specific prior written permission.
18//
19// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
31// Author: robinson@google.com (Will Robinson)
32
33// LINT: LEGACY_NAMES
34
35syntax = "proto2";
36
37package google.protobuf.internal;
38
39// A message where tag numbers are listed out of order, to allow us to test our
40// canonicalization of serialized output, which should always be in tag order.
41// We also mix in some extensions for extra fun.
42message OutOfOrderFields {
43  optional   sint32 optional_sint32   =  5;
44  extensions 4 to 4;
45  optional   uint32 optional_uint32   =  3;
46  extensions 2 to 2;
47  optional    int32 optional_int32    =  1;
48};
49
50
51extend OutOfOrderFields {
52  optional   uint64 optional_uint64   =  4;
53  optional    int64 optional_int64    =  2;
54}
55
56enum is {                               // top level enum keyword
57  default = 0;
58  else = 1;                             // top level enum value keyword
59}
60
61message class {                         // message keyword
62  optional int32 int_field = 1;
63  optional int32 if = 2;                // field keyword
64  optional is as = 3;                   // enum field keyword
65  optional is enum_field = 4;
66  enum for {                            // nested enum keyword
67    default = 0;
68    True = 1;                           // nested enum value keyword
69  }
70  optional for nested_enum_field = 5;
71  message try {
72    optional int32 field = 1;
73    extensions 999 to 9999;
74  }
75  optional try nested_message = 6;
76  extensions 999 to 9999;
77}
78
79extend class {
80  optional int32 continue = 1001;       // top level extension keyword
81}
82
83extend class.try {
84  optional int32 with = 1001;
85}
86
87message ExtendClass {
88  extend class {
89    optional int32 return = 1002;       // nested extension keyword
90  }
91}
92
93message TestFullKeyword {
94  optional google.protobuf.internal.OutOfOrderFields field1 = 1;
95  optional google.protobuf.internal.class field2 = 2;
96}
97
98// TODO(jieluo): Add keyword support for service.
99// service False {
100//   rpc Bar(class) returns (class);
101// }
102
103message LotsNestedMessage {
104  message B0 {}
105  message B1 {}
106  message B2 {}
107  message B3 {}
108  message B4 {}
109  message B5 {}
110  message B6 {}
111  message B7 {}
112  message B8 {}
113  message B9 {}
114  message B10 {}
115  message B11 {}
116  message B12 {}
117  message B13 {}
118  message B14 {}
119  message B15 {}
120  message B16 {}
121  message B17 {}
122  message B18 {}
123  message B19 {}
124  message B20 {}
125  message B21 {}
126  message B22 {}
127  message B23 {}
128  message B24 {}
129  message B25 {}
130  message B26 {}
131  message B27 {}
132  message B28 {}
133  message B29 {}
134  message B30 {}
135  message B31 {}
136  message B32 {}
137  message B33 {}
138  message B34 {}
139  message B35 {}
140  message B36 {}
141  message B37 {}
142  message B38 {}
143  message B39 {}
144  message B40 {}
145  message B41 {}
146  message B42 {}
147  message B43 {}
148  message B44 {}
149  message B45 {}
150  message B46 {}
151  message B47 {}
152  message B48 {}
153  message B49 {}
154  message B50 {}
155  message B51 {}
156  message B52 {}
157  message B53 {}
158  message B54 {}
159  message B55 {}
160  message B56 {}
161  message B57 {}
162  message B58 {}
163  message B59 {}
164  message B60 {}
165  message B61 {}
166  message B62 {}
167  message B63 {}
168  message B64 {}
169  message B65 {}
170  message B66 {}
171  message B67 {}
172  message B68 {}
173  message B69 {}
174  message B70 {}
175  message B71 {}
176  message B72 {}
177  message B73 {}
178  message B74 {}
179  message B75 {}
180  message B76 {}
181  message B77 {}
182  message B78 {}
183  message B79 {}
184  message B80 {}
185  message B81 {}
186  message B82 {}
187  message B83 {}
188  message B84 {}
189  message B85 {}
190  message B86 {}
191  message B87 {}
192  message B88 {}
193  message B89 {}
194  message B90 {}
195  message B91 {}
196  message B92 {}
197  message B93 {}
198  message B94 {}
199  message B95 {}
200  message B96 {}
201  message B97 {}
202  message B98 {}
203  message B99 {}
204  message B100 {}
205  message B101 {}
206  message B102 {}
207  message B103 {}
208  message B104 {}
209  message B105 {}
210  message B106 {}
211  message B107 {}
212  message B108 {}
213  message B109 {}
214  message B110 {}
215  message B111 {}
216  message B112 {}
217  message B113 {}
218  message B114 {}
219  message B115 {}
220  message B116 {}
221  message B117 {}
222  message B118 {}
223  message B119 {}
224  message B120 {}
225  message B121 {}
226  message B122 {}
227  message B123 {}
228  message B124 {}
229  message B125 {}
230  message B126 {}
231  message B127 {}
232  message B128 {}
233  message B129 {}
234  message B130 {}
235  message B131 {}
236  message B132 {}
237  message B133 {}
238  message B134 {}
239  message B135 {}
240  message B136 {}
241  message B137 {}
242  message B138 {}
243  message B139 {}
244  message B140 {}
245  message B141 {}
246  message B142 {}
247  message B143 {}
248  message B144 {}
249  message B145 {}
250  message B146 {}
251  message B147 {}
252  message B148 {}
253  message B149 {}
254  message B150 {}
255  message B151 {}
256  message B152 {}
257  message B153 {}
258  message B154 {}
259  message B155 {}
260  message B156 {}
261  message B157 {}
262  message B158 {}
263  message B159 {}
264  message B160 {}
265  message B161 {}
266  message B162 {}
267  message B163 {}
268  message B164 {}
269  message B165 {}
270  message B166 {}
271  message B167 {}
272  message B168 {}
273  message B169 {}
274  message B170 {}
275  message B171 {}
276  message B172 {}
277  message B173 {}
278  message B174 {}
279  message B175 {}
280  message B176 {}
281  message B177 {}
282  message B178 {}
283  message B179 {}
284  message B180 {}
285  message B181 {}
286  message B182 {}
287  message B183 {}
288  message B184 {}
289  message B185 {}
290  message B186 {}
291  message B187 {}
292  message B188 {}
293  message B189 {}
294  message B190 {}
295  message B191 {}
296  message B192 {}
297  message B193 {}
298  message B194 {}
299  message B195 {}
300  message B196 {}
301  message B197 {}
302  message B198 {}
303  message B199 {}
304  message B200 {}
305  message B201 {}
306  message B202 {}
307  message B203 {}
308  message B204 {}
309  message B205 {}
310  message B206 {}
311  message B207 {}
312  message B208 {}
313  message B209 {}
314  message B210 {}
315  message B211 {}
316  message B212 {}
317  message B213 {}
318  message B214 {}
319  message B215 {}
320  message B216 {}
321  message B217 {}
322  message B218 {}
323  message B219 {}
324  message B220 {}
325  message B221 {}
326  message B222 {}
327  message B223 {}
328  message B224 {}
329  message B225 {}
330  message B226 {}
331  message B227 {}
332  message B228 {}
333  message B229 {}
334  message B230 {}
335  message B231 {}
336  message B232 {}
337  message B233 {}
338  message B234 {}
339  message B235 {}
340  message B236 {}
341  message B237 {}
342  message B238 {}
343  message B239 {}
344  message B240 {}
345  message B241 {}
346  message B242 {}
347  message B243 {}
348  message B244 {}
349  message B245 {}
350  message B246 {}
351  message B247 {}
352  message B248 {}
353  message B249 {}
354  message B250 {}
355  message B251 {}
356  message B252 {}
357  message B253 {}
358  message B254 {}
359  message B255 {}
360}
361