1 // A Bison parser, made by GNU Bison 3.8.2.
2 
3 // Skeleton interface for Bison GLR parsers in C++
4 
5 // Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc.
6 
7 // This program is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 // GNU General Public License for more details.
16 
17 // You should have received a copy of the GNU General Public License
18 // along with this program.  If not, see <https://www.gnu.org/licenses/>.
19 
20 // As a special exception, you may create a larger work that contains
21 // part or all of the Bison parser skeleton and distribute that work
22 // under terms of your choice, so long as that work isn't itself a
23 // parser generator using the skeleton or a modified version thereof
24 // as a parser skeleton.  Alternatively, if you modify or redistribute
25 // the parser skeleton itself, you may (at your option) remove this
26 // special exception, which will cause the skeleton and the resulting
27 // Bison output files to be licensed under the GNU General Public
28 // License without this special exception.
29 
30 // This special exception was added by the Free Software Foundation in
31 // version 2.2 of Bison.
32 
33 // C++ GLR parser skeleton written by Akim Demaille.
34 
35 // DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
36 // especially those whose name start with YY_ or yy_.  They are
37 // private implementation details that can be changed or removed.
38 
39 #ifndef YY_YY_OUT_SOONG_TEMP_SBOX_112562EDA5E96204D197944B668AA67BD380FC69_OUT_SYSTEM_TOOLS_HIDL_HIDL_GEN_Y_H_INCLUDED
40 # define YY_YY_OUT_SOONG_TEMP_SBOX_112562EDA5E96204D197944B668AA67BD380FC69_OUT_SYSTEM_TOOLS_HIDL_HIDL_GEN_Y_H_INCLUDED
41 
42 #include <iostream>
43 #include <stdexcept>
44 #include <string>
45 
46 #if defined __cplusplus
47 # define YY_CPLUSPLUS __cplusplus
48 #else
49 # define YY_CPLUSPLUS 199711L
50 #endif
51 
52 // Support move semantics when possible.
53 #if 201103L <= YY_CPLUSPLUS
54 # define YY_MOVE           std::move
55 # define YY_MOVE_OR_COPY   move
56 # define YY_MOVE_REF(Type) Type&&
57 # define YY_RVREF(Type)    Type&&
58 # define YY_COPY(Type)     Type
59 #else
60 # define YY_MOVE
61 # define YY_MOVE_OR_COPY   copy
62 # define YY_MOVE_REF(Type) Type&
63 # define YY_RVREF(Type)    const Type&
64 # define YY_COPY(Type)     const Type&
65 #endif
66 
67 // Support noexcept when possible.
68 #if 201103L <= YY_CPLUSPLUS
69 # define YY_NOEXCEPT noexcept
70 # define YY_NOTHROW
71 #else
72 # define YY_NOEXCEPT
73 # define YY_NOTHROW throw ()
74 #endif
75 
76 // Support constexpr when possible.
77 #if 201703 <= YY_CPLUSPLUS
78 # define YY_CONSTEXPR constexpr
79 #else
80 # define YY_CONSTEXPR
81 #endif
82 # include "location.hh"
83 
84 
85 // Whether we are compiled with exception support.
86 #ifndef YY_EXCEPTIONS
87 # if defined __GNUC__ && !defined __EXCEPTIONS
88 #  define YY_EXCEPTIONS 0
89 # else
90 #  define YY_EXCEPTIONS 1
91 # endif
92 #endif
93 
94 /* Debug traces.  */
95 #ifndef YYDEBUG
96 # define YYDEBUG 1
97 #endif
98 
99 namespace yy {
100 #line 101 "out/soong/.intermediates/system/tools/hidl/libhidl-gen-ast/linux_glibc_x86_64_static/gen/yacc/system/tools/hidl/hidl-gen_y.h"
101 
102 
103 
104 
105   /// A Bison parser.
106   class parser
107   {
108   public:
109 #ifdef YYSTYPE
110 # ifdef __GNUC__
111 #  pragma GCC message "bison: do not #define YYSTYPE in C++, use %define api.value.type"
112 # endif
113     typedef YYSTYPE value_type;
114 #else
115     /// Symbol semantic values.
116     union value_type
117     {
118 #line 316 "system/tools/hidl/hidl-gen_y.yy"
119 
120     const char *str;
121     android::Type* type;
122     android::Reference<android::Type>* referenceToType;
123     android::ArrayType *arrayType;
124     android::TemplatedType *templatedType;
125     android::FQName *fqName;
126     android::CompoundType *compoundType;
127     android::NamedReference<android::Type>* field;
128     std::vector<android::NamedReference<android::Type>*>* fields;
129     android::EnumValue *enumValue;
130     android::ConstantExpression *constantExpression;
131     std::vector<android::EnumValue *> *enumValues;
132     android::NamedReference<android::Type>* typedVar;
133     android::TypedVarVector *typedVars;
134     android::Method *method;
135     android::CompoundType::Style compoundStyle;
136     std::vector<std::string> *stringVec;
137     android::AnnotationParam *annotationParam;
138     android::AnnotationParamVector *annotationParams;
139     android::Annotation *annotation;
140     std::vector<android::Annotation *> *annotations;
141     android::DocComment* docComment;
142     android::DocCommentable* docCommentable;
143 
144 #line 145 "out/soong/.intermediates/system/tools/hidl/libhidl-gen-ast/linux_glibc_x86_64_static/gen/yacc/system/tools/hidl/hidl-gen_y.h"
145 
146     };
147 #endif
148     /// Backward compatibility (Bison 3.8).
149     typedef value_type semantic_type;
150 
151     /// Symbol locations.
152     typedef location location_type;
153 
154     /// Syntax errors thrown from user actions.
155     struct syntax_error : std::runtime_error
156     {
syntax_errorsyntax_error157       syntax_error (const location_type& l, const std::string& m)
158         : std::runtime_error (m)
159         , location (l)
160       {}
161 
syntax_errorsyntax_error162       syntax_error (const syntax_error& s)
163         : std::runtime_error (s.what ())
164         , location (s.location)
165       {}
166 
167       ~syntax_error () YY_NOEXCEPT YY_NOTHROW;
168 
169       location_type location;
170     };
171 
172     /// Token kinds.
173     struct token
174     {
175       enum token_kind_type
176       {
177         YYEMPTY = -2,
178     YYEOF = 0,                     // "end of file"
179     YYerror = 256,                 // error
180     YYUNDEF = 257,                 // "invalid token"
181     MULTILINE_COMMENT = 258,       // "multiline comment"
182     DOC_COMMENT = 259,             // "doc comment"
183     ENUM = 260,                    // "keyword `enum`"
184     EXTENDS = 261,                 // "keyword `extends`"
185     FQNAME = 262,                  // "fully-qualified name"
186     GENERATES = 263,               // "keyword `generates`"
187     IDENTIFIER = 264,              // "identifier"
188     IMPORT = 265,                  // "keyword `import`"
189     INTEGER = 266,                 // "integer value"
190     FLOAT = 267,                   // "float value"
191     INTERFACE = 268,               // "keyword `interface`"
192     PACKAGE = 269,                 // "keyword `package`"
193     TYPE = 270,                    // "type"
194     STRUCT = 271,                  // "keyword `struct`"
195     STRING_LITERAL = 272,          // "string literal"
196     TYPEDEF = 273,                 // "keyword `typedef`"
197     UNION = 274,                   // "keyword `union`"
198     SAFE_UNION = 275,              // "keyword `safe_union`"
199     TEMPLATED = 276,               // "templated type"
200     ONEWAY = 277,                  // "keyword `oneway`"
201     UNKNOWN = 278,                 // "unknown character"
202     LOGICAL_OR = 279,              // LOGICAL_OR
203     LOGICAL_AND = 280,             // LOGICAL_AND
204     EQUALITY = 281,                // EQUALITY
205     NEQ = 282,                     // NEQ
206     LEQ = 283,                     // LEQ
207     GEQ = 284,                     // GEQ
208     LSHIFT = 285,                  // LSHIFT
209     RSHIFT = 286,                  // RSHIFT
210     UNARY_MINUS = 287,             // UNARY_MINUS
211     UNARY_PLUS = 288               // UNARY_PLUS
212       };
213       /// Backward compatibility alias (Bison 3.6).
214       typedef token_kind_type yytokentype;
215     };
216 
217     /// Token kind, as returned by yylex.
218     typedef token::token_kind_type token_kind_type;
219 
220     /// Backward compatibility alias (Bison 3.6).
221     typedef token_kind_type token_type;
222 
223     /// Symbol kinds.
224     struct symbol_kind
225     {
226       enum symbol_kind_type
227       {
228         YYNTOKENS = 59, ///< Number of tokens.
229         S_YYEMPTY = -2,
230         S_YYEOF = 0,                             // "end of file"
231         S_YYerror = 1,                           // error
232         S_YYUNDEF = 2,                           // "invalid token"
233         S_MULTILINE_COMMENT = 3,                 // "multiline comment"
234         S_DOC_COMMENT = 4,                       // "doc comment"
235         S_ENUM = 5,                              // "keyword `enum`"
236         S_EXTENDS = 6,                           // "keyword `extends`"
237         S_FQNAME = 7,                            // "fully-qualified name"
238         S_GENERATES = 8,                         // "keyword `generates`"
239         S_IDENTIFIER = 9,                        // "identifier"
240         S_IMPORT = 10,                           // "keyword `import`"
241         S_INTEGER = 11,                          // "integer value"
242         S_FLOAT = 12,                            // "float value"
243         S_INTERFACE = 13,                        // "keyword `interface`"
244         S_PACKAGE = 14,                          // "keyword `package`"
245         S_TYPE = 15,                             // "type"
246         S_STRUCT = 16,                           // "keyword `struct`"
247         S_STRING_LITERAL = 17,                   // "string literal"
248         S_TYPEDEF = 18,                          // "keyword `typedef`"
249         S_UNION = 19,                            // "keyword `union`"
250         S_SAFE_UNION = 20,                       // "keyword `safe_union`"
251         S_TEMPLATED = 21,                        // "templated type"
252         S_ONEWAY = 22,                           // "keyword `oneway`"
253         S_UNKNOWN = 23,                          // "unknown character"
254         S_24_ = 24,                              // '?'
255         S_25_ = 25,                              // ':'
256         S_LOGICAL_OR = 26,                       // LOGICAL_OR
257         S_LOGICAL_AND = 27,                      // LOGICAL_AND
258         S_28_ = 28,                              // '|'
259         S_29_ = 29,                              // '^'
260         S_30_ = 30,                              // '&'
261         S_EQUALITY = 31,                         // EQUALITY
262         S_NEQ = 32,                              // NEQ
263         S_33_ = 33,                              // '<'
264         S_34_ = 34,                              // '>'
265         S_LEQ = 35,                              // LEQ
266         S_GEQ = 36,                              // GEQ
267         S_LSHIFT = 37,                           // LSHIFT
268         S_RSHIFT = 38,                           // RSHIFT
269         S_39_ = 39,                              // '+'
270         S_40_ = 40,                              // '-'
271         S_41_ = 41,                              // '*'
272         S_42_ = 42,                              // '/'
273         S_43_ = 43,                              // '%'
274         S_UNARY_MINUS = 44,                      // UNARY_MINUS
275         S_UNARY_PLUS = 45,                       // UNARY_PLUS
276         S_46_ = 46,                              // '!'
277         S_47_ = 47,                              // '~'
278         S_48_ = 48,                              // '#'
279         S_49_ = 49,                              // '@'
280         S_50_ = 50,                              // '('
281         S_51_ = 51,                              // ')'
282         S_52_ = 52,                              // ','
283         S_53_ = 53,                              // '='
284         S_54_ = 54,                              // '{'
285         S_55_ = 55,                              // '}'
286         S_56_ = 56,                              // ';'
287         S_57_ = 57,                              // '['
288         S_58_ = 58,                              // ']'
289         S_YYACCEPT = 59,                         // $accept
290         S_program = 60,                          // program
291         S_doc_comment = 61,                      // doc_comment
292         S_doc_comments = 62,                     // doc_comments
293         S_ignore_doc_comments = 63,              // ignore_doc_comments
294         S_valid_identifier = 64,                 // valid_identifier
295         S_valid_type_name = 65,                  // valid_type_name
296         S_opt_annotations = 66,                  // opt_annotations
297         S_annotation = 67,                       // annotation
298         S_opt_annotation_params = 68,            // opt_annotation_params
299         S_annotation_params = 69,                // annotation_params
300         S_annotation_param = 70,                 // annotation_param
301         S_annotation_string_value = 71,          // annotation_string_value
302         S_annotation_string_values = 72,         // annotation_string_values
303         S_error_stmt = 73,                       // error_stmt
304         S_require_semicolon = 74,                // require_semicolon
305         S_fqname = 75,                           // fqname
306         S_fqtype = 76,                           // fqtype
307         S_package = 77,                          // package
308         S_import_stmt = 78,                      // import_stmt
309         S_opt_extends = 79,                      // opt_extends
310         S_interface_declarations = 80,           // interface_declarations
311         S_declarations = 81,                     // declarations
312         S_commentable_declaration = 82,          // commentable_declaration
313         S_commentable_type_declaration = 83,     // commentable_type_declaration
314         S_type_declaration = 84,                 // type_declaration
315         S_type_declaration_body = 85,            // type_declaration_body
316         S_interface_declaration = 86,            // interface_declaration
317         S_87_1 = 87,                             // $@1
318         S_interface_declaration_body = 88,       // interface_declaration_body
319         S_typedef_declaration = 89,              // typedef_declaration
320         S_const_expr = 90,                       // const_expr
321         S_commentable_method_declaration = 91,   // commentable_method_declaration
322         S_method_declaration = 92,               // method_declaration
323         S_typed_vars = 93,                       // typed_vars
324         S_non_empty_typed_vars = 94,             // non_empty_typed_vars
325         S_typed_var = 95,                        // typed_var
326         S_uncommented_typed_var = 96,            // uncommented_typed_var
327         S_struct_or_union_keyword = 97,          // struct_or_union_keyword
328         S_named_struct_or_union_declaration = 98, // named_struct_or_union_declaration
329         S_99_2 = 99,                             // $@2
330         S_struct_or_union_body = 100,            // struct_or_union_body
331         S_field_declarations = 101,              // field_declarations
332         S_commentable_field_declaration = 102,   // commentable_field_declaration
333         S_field_declaration = 103,               // field_declaration
334         S_annotated_compound_declaration = 104,  // annotated_compound_declaration
335         S_compound_declaration = 105,            // compound_declaration
336         S_enum_storage_type = 106,               // enum_storage_type
337         S_named_enum_declaration = 107,          // named_enum_declaration
338         S_108_3 = 108,                           // $@3
339         S_enum_declaration_body = 109,           // enum_declaration_body
340         S_commentable_enum_value = 110,          // commentable_enum_value
341         S_enum_value = 111,                      // enum_value
342         S_enum_values = 112,                     // enum_values
343         S_array_type_base = 113,                 // array_type_base
344         S_array_type = 114,                      // array_type
345         S_type = 115,                            // type
346         S_type_or_inplace_compound_declaration = 116 // type_or_inplace_compound_declaration
347       };
348     };
349 
350     /// (Internal) symbol kind.
351     typedef symbol_kind::symbol_kind_type symbol_kind_type;
352 
353     /// The number of tokens.
354     static const symbol_kind_type YYNTOKENS = symbol_kind::YYNTOKENS;
355 
356 
357     /// Build a parser object.
358     parser (void* scanner_yyarg, android::AST* const ast_yyarg, android::Scope** const scope_yyarg);
359     virtual ~parser ();
360 
361     /// Parse.  An alias for parse ().
362     /// \returns  0 iff parsing succeeded.
363     int operator() ();
364 
365     /// Parse.
366     /// \returns  0 iff parsing succeeded.
367     virtual int parse ();
368 
369 #if YYDEBUG
370     /// The current debugging stream.
371     std::ostream& debug_stream () const;
372     /// Set the current debugging stream.
373     void set_debug_stream (std::ostream &);
374 
375     /// Type for debugging levels.
376     typedef int debug_level_type;
377     /// The current debugging level.
378     debug_level_type debug_level () const;
379     /// Set the current debugging level.
380     void set_debug_level (debug_level_type l);
381 #endif
382 
383     /// Report a syntax error.
384     /// \param loc    where the syntax error is found.
385     /// \param msg    a description of the syntax error.
386     virtual void error (const location_type& loc, const std::string& msg);
387 
388 # if YYDEBUG
389   public:
390     /// \brief Report a symbol value on the debug stream.
391     /// \param yykind       The symbol kind.
392     /// \param yyvaluep     Its semantic value.
393     /// \param yylocationp  Its location.
394     virtual void yy_symbol_value_print_ (symbol_kind_type yykind,
395                                          const value_type* yyvaluep,
396                                          const location_type* yylocationp) const;
397     /// \brief Report a symbol on the debug stream.
398     /// \param yykind       The symbol kind.
399     /// \param yyvaluep     Its semantic value.
400     /// \param yylocationp  Its location.
401     virtual void yy_symbol_print_ (symbol_kind_type yykind,
402                                    const value_type* yyvaluep,
403                                    const location_type* yylocationp) const;
404   private:
405     /// Debug stream.
406     std::ostream* yycdebug_;
407 #endif
408 
409 
410     // User arguments.
411     void* scanner;
412     android::AST* const ast;
413     android::Scope** const scope;
414   };
415 
416 } // yy
417 #line 418 "out/soong/.intermediates/system/tools/hidl/libhidl-gen-ast/linux_glibc_x86_64_static/gen/yacc/system/tools/hidl/hidl-gen_y.h"
418 
419 
420 
421 
422 #endif // !YY_YY_OUT_SOONG_TEMP_SBOX_112562EDA5E96204D197944B668AA67BD380FC69_OUT_SYSTEM_TOOLS_HIDL_HIDL_GEN_Y_H_INCLUDED
423