parse.y (976e3645923bdd2fe7893aae33fd7a21098bfb28) | parse.y (9ab55d7f240fb05f84ec3b5e37f0c3ab2ce69053) |
---|---|
1/* SPDX-License-Identifier: GPL-2.0-or-later */ 2/* 3 * C global declaration parser for genksyms. 4 * Copyright 1996, 1997 Linux International. 5 * 6 * New implementation contributed by Richard Henderson <rth@tamu.edu> 7 * Based on original work by Bjorn Ekwall <bj0rn@blox.se> 8 * --- 66 unchanged lines hidden (view full) --- 75%token INLINE_KEYW 76%token INT_KEYW 77%token LONG_KEYW 78%token REGISTER_KEYW 79%token RESTRICT_KEYW 80%token SHORT_KEYW 81%token SIGNED_KEYW 82%token STATIC_KEYW | 1/* SPDX-License-Identifier: GPL-2.0-or-later */ 2/* 3 * C global declaration parser for genksyms. 4 * Copyright 1996, 1997 Linux International. 5 * 6 * New implementation contributed by Richard Henderson <rth@tamu.edu> 7 * Based on original work by Bjorn Ekwall <bj0rn@blox.se> 8 * --- 66 unchanged lines hidden (view full) --- 75%token INLINE_KEYW 76%token INT_KEYW 77%token LONG_KEYW 78%token REGISTER_KEYW 79%token RESTRICT_KEYW 80%token SHORT_KEYW 81%token SIGNED_KEYW 82%token STATIC_KEYW |
83%token STATIC_ASSERT_KEYW |
|
83%token STRUCT_KEYW 84%token TYPEDEF_KEYW 85%token UNION_KEYW 86%token UNSIGNED_KEYW 87%token VOID_KEYW 88%token VOLATILE_KEYW 89%token TYPEOF_KEYW 90%token VA_LIST_KEYW 91 92%token EXPORT_SYMBOL_KEYW 93 94%token ASM_PHRASE 95%token ATTRIBUTE_PHRASE 96%token TYPEOF_PHRASE 97%token BRACE_PHRASE 98%token BRACKET_PHRASE 99%token EXPRESSION_PHRASE | 84%token STRUCT_KEYW 85%token TYPEDEF_KEYW 86%token UNION_KEYW 87%token UNSIGNED_KEYW 88%token VOID_KEYW 89%token VOLATILE_KEYW 90%token TYPEOF_KEYW 91%token VA_LIST_KEYW 92 93%token EXPORT_SYMBOL_KEYW 94 95%token ASM_PHRASE 96%token ATTRIBUTE_PHRASE 97%token TYPEOF_PHRASE 98%token BRACE_PHRASE 99%token BRACKET_PHRASE 100%token EXPRESSION_PHRASE |
101%token STATIC_ASSERT_PHRASE |
|
100 101%token CHAR 102%token DOTS 103%token IDENT 104%token INT 105%token REAL 106%token STRING 107%token TYPE --- 17 unchanged lines hidden (view full) --- 125 EXTENSION_KEYW TYPEDEF_KEYW { is_typedef = 1; } simple_declaration 126 { $$ = $4; } 127 | TYPEDEF_KEYW { is_typedef = 1; } simple_declaration 128 { $$ = $3; } 129 | simple_declaration 130 | function_definition 131 | asm_definition 132 | export_definition | 102 103%token CHAR 104%token DOTS 105%token IDENT 106%token INT 107%token REAL 108%token STRING 109%token TYPE --- 17 unchanged lines hidden (view full) --- 127 EXTENSION_KEYW TYPEDEF_KEYW { is_typedef = 1; } simple_declaration 128 { $$ = $4; } 129 | TYPEDEF_KEYW { is_typedef = 1; } simple_declaration 130 { $$ = $3; } 131 | simple_declaration 132 | function_definition 133 | asm_definition 134 | export_definition |
135 | static_assert |
|
133 | error ';' { $$ = $2; } 134 | error '}' { $$ = $2; } 135 ; 136 137simple_declaration: 138 decl_specifier_seq_opt init_declarator_list_opt ';' 139 { if (current_name) { 140 struct string_list *decl = (*$3)->next; --- 347 unchanged lines hidden (view full) --- 488 | ASM_PHRASE 489 ; 490 491export_definition: 492 EXPORT_SYMBOL_KEYW '(' IDENT ')' ';' 493 { export_symbol((*$3)->string); $$ = $5; } 494 ; 495 | 136 | error ';' { $$ = $2; } 137 | error '}' { $$ = $2; } 138 ; 139 140simple_declaration: 141 decl_specifier_seq_opt init_declarator_list_opt ';' 142 { if (current_name) { 143 struct string_list *decl = (*$3)->next; --- 347 unchanged lines hidden (view full) --- 491 | ASM_PHRASE 492 ; 493 494export_definition: 495 EXPORT_SYMBOL_KEYW '(' IDENT ')' ';' 496 { export_symbol((*$3)->string); $$ = $5; } 497 ; 498 |
499/* Ignore any module scoped _Static_assert(...) */ 500static_assert: 501 STATIC_ASSERT_PHRASE ';' { $$ = $2; } 502 ; |
|
496 497%% 498 499static void 500yyerror(const char *e) 501{ 502 error_with_pos("%s", e); 503} | 503 504%% 505 506static void 507yyerror(const char *e) 508{ 509 error_with_pos("%s", e); 510} |