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_3B9FF9D3CA22BEAB2CC2D3F37232599303FBE04F_OUT_SYSTEM_TOOLS_AIDL_AIDL_LANGUAGE_Y_H_INCLUDED 40 # define YY_YY_OUT_SOONG_TEMP_SBOX_3B9FF9D3CA22BEAB2CC2D3F37232599303FBE04F_OUT_SYSTEM_TOOLS_AIDL_AIDL_LANGUAGE_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 0 97 #endif 98 99 namespace yy { 100 #line 101 "out/soong/.intermediates/system/tools/aidl/libaidl-common/linux_glibc_x86_64_static/gen/yacc/system/tools/aidl/aidl_language_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 70 "system/tools/aidl/aidl_language_y.yy" 119 120 AidlToken* token; 121 char character; 122 std::string *str; 123 std::vector<std::unique_ptr<AidlToken>> *token_list; 124 AidlAnnotation* annotation; 125 AidlAnnotationParameter* param; 126 std::map<std::string, std::shared_ptr<AidlConstantValue>>* param_list; 127 std::vector<std::unique_ptr<AidlAnnotation>>* annotation_list; 128 AidlTypeSpecifier* type; 129 AidlArgument* arg; 130 AidlArgument::Direction direction; 131 AidlConstantValue* const_expr; 132 AidlEnumerator* enumerator; 133 std::vector<std::unique_ptr<AidlEnumerator>>* enumerators; 134 std::vector<std::unique_ptr<AidlConstantValue>>* constant_value_list; 135 std::vector<std::unique_ptr<AidlArgument>>* arg_list; 136 AidlVariableDeclaration* variable; 137 AidlMethod* method; 138 AidlMember* constant; 139 std::vector<std::unique_ptr<AidlMember>>* members; 140 AidlDefinedType* declaration; 141 std::vector<std::unique_ptr<AidlTypeSpecifier>>* type_args; 142 std::vector<std::string>* type_params; 143 std::vector<std::unique_ptr<AidlDefinedType>>* declarations; 144 AidlUnstructuredHeaders* unstructured_headers; 145 146 #line 147 "out/soong/.intermediates/system/tools/aidl/libaidl-common/linux_glibc_x86_64_static/gen/yacc/system/tools/aidl/aidl_language_y.h" 147 148 }; 149 #endif 150 /// Backward compatibility (Bison 3.8). 151 typedef value_type semantic_type; 152 153 /// Symbol locations. 154 typedef location location_type; 155 156 /// Syntax errors thrown from user actions. 157 struct syntax_error : std::runtime_error 158 { syntax_errorsyntax_error159 syntax_error (const location_type& l, const std::string& m) 160 : std::runtime_error (m) 161 , location (l) 162 {} 163 syntax_errorsyntax_error164 syntax_error (const syntax_error& s) 165 : std::runtime_error (s.what ()) 166 , location (s.location) 167 {} 168 169 ~syntax_error () YY_NOEXCEPT YY_NOTHROW; 170 171 location_type location; 172 }; 173 174 /// Token kinds. 175 struct token 176 { 177 enum token_kind_type 178 { 179 YYEMPTY = -2, 180 YYEOF = 0, // "end of file" 181 YYerror = 256, // error 182 YYUNDEF = 257, // "invalid token" 183 PACKAGE = 258, // "package" 184 IMPORT = 259, // "import" 185 ANNOTATION = 260, // "annotation" 186 C_STR = 261, // "string literal" 187 IDENTIFIER = 262, // "identifier" 188 INTERFACE = 263, // "interface" 189 PARCELABLE = 264, // "parcelable" 190 ONEWAY = 265, // "oneway" 191 ENUM = 266, // "enum" 192 UNION = 267, // "union" 193 CONST = 268, // "const" 194 CHARVALUE = 269, // "char literal" 195 FLOATVALUE = 270, // "float literal" 196 HEXVALUE = 271, // "hex literal" 197 INTVALUE = 272, // "int literal" 198 UNKNOWN = 273, // "unrecognized character" 199 CPP_HEADER = 274, // "cpp_header (which can also be used as an identifier)" 200 NDK_HEADER = 275, // "ndk_header (which can also be used as an identifier)" 201 RUST_TYPE = 276, // "rust_type (which can also be used as an identifier)" 202 IN = 277, // "in" 203 INOUT = 278, // "inout" 204 OUT = 279, // "out" 205 TRUE_LITERAL = 280, // "true" 206 FALSE_LITERAL = 281, // "false" 207 LOGICAL_OR = 282, // LOGICAL_OR 208 LOGICAL_AND = 283, // LOGICAL_AND 209 EQUALITY = 284, // EQUALITY 210 NEQ = 285, // NEQ 211 LEQ = 286, // LEQ 212 GEQ = 287, // GEQ 213 LSHIFT = 288, // LSHIFT 214 RSHIFT = 289, // RSHIFT 215 UNARY_PLUS = 290, // UNARY_PLUS 216 UNARY_MINUS = 291 // UNARY_MINUS 217 }; 218 /// Backward compatibility alias (Bison 3.6). 219 typedef token_kind_type yytokentype; 220 }; 221 222 /// Token kind, as returned by yylex. 223 typedef token::token_kind_type token_kind_type; 224 225 /// Backward compatibility alias (Bison 3.6). 226 typedef token_kind_type token_type; 227 228 /// Symbol kinds. 229 struct symbol_kind 230 { 231 enum symbol_kind_type 232 { 233 YYNTOKENS = 59, ///< Number of tokens. 234 S_YYEMPTY = -2, 235 S_YYEOF = 0, // "end of file" 236 S_YYerror = 1, // error 237 S_YYUNDEF = 2, // "invalid token" 238 S_PACKAGE = 3, // "package" 239 S_IMPORT = 4, // "import" 240 S_ANNOTATION = 5, // "annotation" 241 S_C_STR = 6, // "string literal" 242 S_IDENTIFIER = 7, // "identifier" 243 S_INTERFACE = 8, // "interface" 244 S_PARCELABLE = 9, // "parcelable" 245 S_ONEWAY = 10, // "oneway" 246 S_ENUM = 11, // "enum" 247 S_UNION = 12, // "union" 248 S_CONST = 13, // "const" 249 S_CHARVALUE = 14, // "char literal" 250 S_FLOATVALUE = 15, // "float literal" 251 S_HEXVALUE = 16, // "hex literal" 252 S_INTVALUE = 17, // "int literal" 253 S_18_ = 18, // '(' 254 S_19_ = 19, // ')' 255 S_20_ = 20, // ',' 256 S_21_ = 21, // '=' 257 S_22_ = 22, // '[' 258 S_23_ = 23, // ']' 259 S_24_ = 24, // '.' 260 S_25_ = 25, // '{' 261 S_26_ = 26, // '}' 262 S_27_ = 27, // ';' 263 S_UNKNOWN = 28, // "unrecognized character" 264 S_CPP_HEADER = 29, // "cpp_header (which can also be used as an identifier)" 265 S_NDK_HEADER = 30, // "ndk_header (which can also be used as an identifier)" 266 S_RUST_TYPE = 31, // "rust_type (which can also be used as an identifier)" 267 S_IN = 32, // "in" 268 S_INOUT = 33, // "inout" 269 S_OUT = 34, // "out" 270 S_TRUE_LITERAL = 35, // "true" 271 S_FALSE_LITERAL = 36, // "false" 272 S_LOGICAL_OR = 37, // LOGICAL_OR 273 S_LOGICAL_AND = 38, // LOGICAL_AND 274 S_39_ = 39, // '|' 275 S_40_ = 40, // '^' 276 S_41_ = 41, // '&' 277 S_EQUALITY = 42, // EQUALITY 278 S_NEQ = 43, // NEQ 279 S_44_ = 44, // '<' 280 S_45_ = 45, // '>' 281 S_LEQ = 46, // LEQ 282 S_GEQ = 47, // GEQ 283 S_LSHIFT = 48, // LSHIFT 284 S_RSHIFT = 49, // RSHIFT 285 S_50_ = 50, // '+' 286 S_51_ = 51, // '-' 287 S_52_ = 52, // '*' 288 S_53_ = 53, // '/' 289 S_54_ = 54, // '%' 290 S_UNARY_PLUS = 55, // UNARY_PLUS 291 S_UNARY_MINUS = 56, // UNARY_MINUS 292 S_57_ = 57, // '!' 293 S_58_ = 58, // '~' 294 S_YYACCEPT = 59, // $accept 295 S_document = 60, // document 296 S_identifier = 61, // identifier 297 S_optional_package = 62, // optional_package 298 S_imports = 63, // imports 299 S_import = 64, // import 300 S_qualified_name = 65, // qualified_name 301 S_decls = 66, // decls 302 S_decl = 67, // decl 303 S_unannotated_decl = 68, // unannotated_decl 304 S_type_params = 69, // type_params 305 S_optional_type_params = 70, // optional_type_params 306 S_optional_unstructured_headers = 71, // optional_unstructured_headers 307 S_parcelable_decl = 72, // parcelable_decl 308 S_parcelable_members = 73, // parcelable_members 309 S_variable_decl = 74, // variable_decl 310 S_interface_decl = 75, // interface_decl 311 S_interface_members = 76, // interface_members 312 S_const_expr = 77, // const_expr 313 S_constant_value_list = 78, // constant_value_list 314 S_constant_value_non_empty_list = 79, // constant_value_non_empty_list 315 S_constant_decl = 80, // constant_decl 316 S_enumerator = 81, // enumerator 317 S_enumerators = 82, // enumerators 318 S_enum_decl_body = 83, // enum_decl_body 319 S_enum_decl = 84, // enum_decl 320 S_union_decl = 85, // union_decl 321 S_method_decl = 86, // method_decl 322 S_arg_non_empty_list = 87, // arg_non_empty_list 323 S_arg_list = 88, // arg_list 324 S_arg = 89, // arg 325 S_non_array_type = 90, // non_array_type 326 S_type = 91, // type 327 S_type_args = 92, // type_args 328 S_annotation_list = 93, // annotation_list 329 S_parameter = 94, // parameter 330 S_parameter_list = 95, // parameter_list 331 S_parameter_non_empty_list = 96, // parameter_non_empty_list 332 S_annotation = 97, // annotation 333 S_direction = 98 // direction 334 }; 335 }; 336 337 /// (Internal) symbol kind. 338 typedef symbol_kind::symbol_kind_type symbol_kind_type; 339 340 /// The number of tokens. 341 static const symbol_kind_type YYNTOKENS = symbol_kind::YYNTOKENS; 342 343 344 /// Build a parser object. 345 parser (Parser* ps_yyarg); 346 virtual ~parser (); 347 348 /// Parse. An alias for parse (). 349 /// \returns 0 iff parsing succeeded. 350 int operator() (); 351 352 /// Parse. 353 /// \returns 0 iff parsing succeeded. 354 virtual int parse (); 355 356 #if YYDEBUG 357 /// The current debugging stream. 358 std::ostream& debug_stream () const; 359 /// Set the current debugging stream. 360 void set_debug_stream (std::ostream &); 361 362 /// Type for debugging levels. 363 typedef int debug_level_type; 364 /// The current debugging level. 365 debug_level_type debug_level () const; 366 /// Set the current debugging level. 367 void set_debug_level (debug_level_type l); 368 #endif 369 370 /// Report a syntax error. 371 /// \param loc where the syntax error is found. 372 /// \param msg a description of the syntax error. 373 virtual void error (const location_type& loc, const std::string& msg); 374 375 # if YYDEBUG 376 public: 377 /// \brief Report a symbol value on the debug stream. 378 /// \param yykind The symbol kind. 379 /// \param yyvaluep Its semantic value. 380 /// \param yylocationp Its location. 381 virtual void yy_symbol_value_print_ (symbol_kind_type yykind, 382 const value_type* yyvaluep, 383 const location_type* yylocationp) const; 384 /// \brief Report a symbol on the debug stream. 385 /// \param yykind The symbol kind. 386 /// \param yyvaluep Its semantic value. 387 /// \param yylocationp Its location. 388 virtual void yy_symbol_print_ (symbol_kind_type yykind, 389 const value_type* yyvaluep, 390 const location_type* yylocationp) const; 391 private: 392 /// Debug stream. 393 std::ostream* yycdebug_; 394 #endif 395 396 397 // User arguments. 398 Parser* ps; 399 }; 400 401 } // yy 402 #line 403 "out/soong/.intermediates/system/tools/aidl/libaidl-common/linux_glibc_x86_64_static/gen/yacc/system/tools/aidl/aidl_language_y.h" 403 404 405 406 407 #endif // !YY_YY_OUT_SOONG_TEMP_SBOX_3B9FF9D3CA22BEAB2CC2D3F37232599303FBE04F_OUT_SYSTEM_TOOLS_AIDL_AIDL_LANGUAGE_Y_H_INCLUDED 408