scripts/kconfig/parser.y
Source file repositories/reference/linux-study-clean/scripts/kconfig/parser.y
File Facts
- System
- Linux kernel
- Corpus path
scripts/kconfig/parser.y- Extension
.y- Size
- 17547 bytes
- Lines
- 798
- Domain
- Support Tooling And Documentation
- Bucket
- scripts
- Inferred role
- Support Tooling And Documentation: scripts
- Status
- atlas-only
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
ctype.hstdarg.hstdio.hstdlib.hstring.hstdbool.hxalloc.hlkc.hinternal.hpreprocess.h
Detected Declarations
function transitional_check_sanityfunction choice_check_sanityfunction conf_parsefunction menu_for_each_entryfunction zconf_endtokenfunction zconf_errorfunction yyerrorfunction print_quoted_stringfunction print_symbolfunction zconfdump
Annotated Snippet
if (!current_entry->prompt) {
fprintf(stderr, "%s:%d: error: choice member must have a prompt\n",
current_entry->filename, current_entry->lineno);
yynerrs++;
}
if (current_entry->sym->type != S_BOOLEAN) {
fprintf(stderr, "%s:%d: error: choice member must be bool\n",
current_entry->filename, current_entry->lineno);
yynerrs++;
}
list_add_tail(¤t_entry->sym->choice_link,
¤t_choice->choice_members);
}
printd(DEBUG_PARSE, "%s:%d:endconfig\n", cur_filename, cur_lineno);
};
menuconfig_entry_start: T_MENUCONFIG nonconst_symbol T_EOL
{
menu_add_entry($2, M_MENU);
printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", cur_filename, cur_lineno, $2->name);
};
menuconfig_stmt: menuconfig_entry_start config_option_list
{
if (current_entry->prompt)
current_entry->prompt->type = P_MENU;
else
zconf_error("menuconfig statement without prompt");
printd(DEBUG_PARSE, "%s:%d:endconfig\n", cur_filename, cur_lineno);
};
config_option_list:
/* empty */
| config_option_list config_option
| config_option_list depends
| config_option_list help
;
config_option: type prompt_stmt_opt T_EOL
{
menu_set_type($1);
printd(DEBUG_PARSE, "%s:%d:type(%u)\n", cur_filename, cur_lineno, $1);
};
config_option: T_PROMPT T_WORD_QUOTE if_expr T_EOL
{
menu_add_prompt(P_PROMPT, $2, $3);
printd(DEBUG_PARSE, "%s:%d:prompt\n", cur_filename, cur_lineno);
};
config_option: T_TRANSITIONAL T_EOL
{
current_entry->sym->flags |= SYMBOL_TRANS;
printd(DEBUG_PARSE, "%s:%d:transitional\n", cur_filename, cur_lineno);
};
config_option: default expr if_expr T_EOL
{
menu_add_expr(P_DEFAULT, $2, $3);
if ($1 != S_UNKNOWN)
menu_set_type($1);
printd(DEBUG_PARSE, "%s:%d:default(%u)\n", cur_filename, cur_lineno,
$1);
};
config_option: T_SELECT nonconst_symbol if_expr T_EOL
{
Annotation
- Immediate include surface: `ctype.h`, `stdarg.h`, `stdio.h`, `stdlib.h`, `string.h`, `stdbool.h`, `xalloc.h`, `lkc.h`.
- Detected declarations: `function transitional_check_sanity`, `function choice_check_sanity`, `function conf_parse`, `function menu_for_each_entry`, `function zconf_endtoken`, `function zconf_error`, `function yyerror`, `function print_quoted_string`, `function print_symbol`, `function zconfdump`.
- Atlas domain: Support Tooling And Documentation / scripts.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.