Lines Matching refs:node
1607 node = self.top_node
1610 if node.list:
1611 node = node.list
1612 elif node.next:
1613 node = node.next
1615 while node.parent:
1616 node = node.parent
1619 if node.item is MENU and expr_value(node.dep) and \
1620 expr_value(node.visibility) and \
1621 node is not self.top_node:
1622 add("# end of {}\n".format(node.prompt[0]))
1625 if node.next:
1626 node = node.next
1634 item = node.item
1652 elif expr_value(node.dep) and \
1653 ((item is MENU and expr_value(node.visibility)) or
1656 add("\n#\n# {}\n#\n".format(node.prompt[0]))
1935 node = self.top_node
1938 if node.list:
1939 node = node.list
1940 elif node.next:
1941 node = node.next
1943 while node.parent:
1944 node = node.parent
1945 if node.next:
1946 node = node.next
1952 if unique_syms and node.item.__class__ is Symbol:
1953 if node.item._visited:
1955 node.item._visited = True
1957 yield node
2932 node = MenuNode()
2933 node.kconfig = self
2934 node.item = sym
2935 node.is_menuconfig = t0 is _T_MENUCONFIG
2936 node.is_configdefault = t0 is _T_CONFIGDEFAULT
2937 node.prompt = node.help = node.list = None
2938 node.parent = parent
2939 node.filename = self.filename
2940 node.linenr = self.linenr
2941 node.include_path = self._include_path
2943 sym.nodes.append(node)
2945 self._parse_props(node)
2947 if node.is_configdefault:
2948 if (node.prompt or
2949 node.dep != self.y or
2950 len(node.ranges) > 0 or
2951 len(node.selects) > 0 or
2952 len(node.implies) > 0):
2955 if node.is_menuconfig and not node.prompt:
2965 prev.next = prev = node
3015 node = MenuNode()
3016 node.item = node.prompt = None
3017 node.parent = parent
3018 node.dep = self._expect_expr_and_eol()
3020 self._parse_block(_T_ENDIF, node, node)
3021 node.list = node.next
3023 prev.next = prev = node
3026 node = MenuNode()
3027 node.kconfig = self
3028 node.item = t0 # _T_MENU == MENU
3029 node.is_menuconfig = True
3030 node.prompt = (self._expect_str_and_eol(), self.y)
3031 node.visibility = self.y
3032 node.parent = parent
3033 node.filename = self.filename
3034 node.linenr = self.linenr
3035 node.include_path = self._include_path
3037 self.menus.append(node)
3039 self._parse_props(node)
3040 self._parse_block(_T_ENDMENU, node, node)
3041 node.list = node.next
3043 prev.next = prev = node
3046 node = MenuNode()
3047 node.kconfig = self
3048 node.item = t0 # _T_COMMENT == COMMENT
3049 node.is_menuconfig = False
3050 node.prompt = (self._expect_str_and_eol(), self.y)
3051 node.list = None
3052 node.parent = parent
3053 node.filename = self.filename
3054 node.linenr = self.linenr
3055 node.include_path = self._include_path
3057 self.comments.append(node)
3059 self._parse_props(node)
3061 prev.next = prev = node
3079 node = MenuNode()
3080 node.kconfig = choice.kconfig = self
3081 node.item = choice
3082 node.is_menuconfig = True
3083 node.prompt = node.help = None
3084 node.parent = parent
3085 node.filename = self.filename
3086 node.linenr = self.linenr
3087 node.include_path = self._include_path
3089 choice.nodes.append(node)
3091 self._parse_props(node)
3092 self._parse_block(_T_ENDCHOICE, node, node)
3093 node.list = node.next
3095 prev.next = prev = node
3132 def _parse_props(self, node): argument
3151 node.dep = self.y
3158 self._set_type(node.item, t0)
3160 self._parse_prompt(node)
3166 node.dep = self._make_and(node.dep,
3170 self._parse_help(node)
3173 if node.item.__class__ is not Symbol:
3176 node.selects.append((self._expect_nonconst_sym(),
3184 node.defaults.append((self._parse_expr(False),
3188 self._set_type(node.item, _DEF_TOKEN_TO_TYPE[t0])
3189 node.defaults.append((self._parse_expr(False),
3193 self._parse_prompt(node)
3196 node.ranges.append((self._expect_sym(), self._expect_sym(),
3200 if node.item.__class__ is not Symbol:
3203 node.implies.append((self._expect_nonconst_sym(),
3210 node.visibility = self._make_and(node.visibility,
3219 node.item.env_var = env_var
3222 node.defaults.append(
3228 "set".format(node.item.name, env_var),
3231 if env_var != node.item.name:
3238 .format(node.item.name, env_var),
3243 self.defconfig_list = node.item
3248 node.item.name),
3257 if node.item is not self.modules:
3269 if node.item.__class__ is not Symbol:
3273 node.item.is_allnoconfig_y = True
3279 if node.item.__class__ is not Choice:
3282 node.item.is_optional = True
3299 def _parse_prompt(self, node): argument
3304 if node.prompt:
3305 self._warn(node.item.name_and_loc +
3315 self._warn(node.item.name_and_loc +
3322 node.prompt = (prompt, self._parse_cond())
3324 def _parse_help(self, node): argument
3325 if node.help is not None:
3326 self._warn(node.item.name_and_loc + " defined with more than "
3339 self._empty_help(node, line)
3352 self._empty_help(node, line)
3377 node.help = "".join(lines).rstrip()
3381 def _empty_help(self, node, line): argument
3382 self._warn(node.item.name_and_loc +
3384 node.help = ""
3496 for node in sym.nodes:
3497 if node.prompt:
3498 depend_on(sym, node.prompt[1])
3531 for node in choice.nodes:
3532 if node.prompt:
3533 depend_on(choice, node.prompt[1])
3585 def _finalize_node(self, node, visible_if): argument
3610 if node.item.__class__ is Symbol:
3612 self._add_props_to_sym(node)
3616 cur = node
3617 while cur.next and _auto_menu_dep(node, cur.next):
3622 cur.parent = node
3624 if cur is not node:
3627 node.list = node.next
3628 node.next = cur.next
3631 elif node.list:
3634 if node.item is MENU:
3635 visible_if = self._make_and(visible_if, node.visibility)
3641 self._propagate_deps(node, visible_if)
3644 cur = node.list
3649 if node.list:
3652 _flatten(node.list)
3653 _remove_ifs(node)
3657 if node.item.__class__ is Choice:
3660 choice = node.item
3661 choice.direct_dep = self._make_or(choice.direct_dep, node.dep)
3662 choice.defaults += node.defaults
3664 _finalize_choice(node)
3666 def _propagate_deps(self, node, visible_if): argument
3676 basedep = node.item if node.item.__class__ is Choice else node.dep
3678 cur = node.list
3718 def _add_props_to_sym(self, node): argument
3728 sym = node.item
3730 if node.is_configdefault:
3735 sym.configdefaults.append((len(sym.defaults), node.defaults))
3739 sym.direct_dep = self._make_or(sym.direct_dep, node.dep)
3741 sym.defaults += node.defaults
3742 sym.ranges += node.ranges
3743 sym.selects += node.selects
3744 sym.implies += node.implies
3747 for target, cond in node.selects:
3754 for target, cond in node.implies:
3874 for node in choice.nodes:
3875 if node.prompt:
3904 for node in sym.nodes:
3905 if node.parent.item is choice:
3906 if not node.prompt:
3910 elif node.prompt:
4000 for node in self.node_iter():
4001 if sym in node.referenced:
4003 .format(node.filename, node.linenr, node)
4699 return {item for node in self.nodes for item in node.referenced}
4706 return [d for node in self.nodes for d in node.orig_defaults]
4713 return [s for node in self.nodes for s in node.orig_selects]
4720 return [i for node in self.nodes for i in node.orig_implies]
4727 return [r for node in self.nodes for r in node.orig_ranges]
4738 for node in self.nodes:
4739 if node.prompt:
4740 add('"{}"'.format(node.prompt[0]))
4775 for node in self.nodes:
4776 add("{}:{}".format(node.filename, node.linenr))
4803 return "\n\n".join(node.custom_str(sc_expr_str_fn)
4804 for node in self.nodes)
4947 for node in self.nodes:
4948 if node.prompt:
5337 return {item for node in self.nodes for item in node.referenced}
5344 return [d for node in self.nodes for d in node.orig_defaults]
5355 for node in self.nodes:
5356 if node.prompt:
5357 add('"{}"'.format(node.prompt[0]))
5381 for node in self.nodes:
5382 add("{}:{}".format(node.filename, node.linenr))
5404 return "\n\n".join(node.custom_str(sc_expr_str_fn)
5405 for node in self.nodes)
6338 for node in sc.nodes:
6339 if node.prompt:
6340 vis = max(vis, expr_value(node.prompt[1]))
6479 ", ".join("{0.filename}:{0.linenr}".format(node)
6480 for node in sc.nodes))
6525 def _flatten(node): argument
6536 while node:
6537 if node.list and not node.prompt and \
6538 node.item.__class__ is not Choice:
6540 last_node = node.list
6542 last_node.parent = node.parent
6547 last_node.next = node.next
6548 node.next = node.list
6549 node.list = None
6551 node = node.next
6554 def _remove_ifs(node): argument
6560 cur = node.list
6564 node.list = cur
6580 def _finalize_choice(node): argument
6585 choice = node.item
6587 cur = node.list