Lines Matching full:node

58 The item contained in a menu node is found in MenuNode.item (note that this can
61 (usually only one). Printing a menu node will print its item, in Kconfig
218 MenuNode objects. The top node of the configuration corresponds to an implicit
223 The top node is found in Kconfig.top_node. From there, you can visit child menu
230 MENU and COMMENT. The prompt of the menu node can be found in MenuNode.prompt,
234 Most symbols will only have a single menu node. A symbol defined in multiple
235 locations will have one menu node for each location. The list of menu nodes for
239 menu node(s) rather than in the Symbol or Choice objects themselves. This makes
242 single menu node, do sym.nodes[0].help and sym.nodes[0].prompt, respectively.
554 The menu node (see the MenuNode class) of the implicit top-level menu.
1155 for node in self.node_iter(unique_syms=True):
1156 item = node.item
1161 elif expr_value(node.dep) and \
1162 ((item is MENU and expr_value(node.visibility)) or
1165 f.write("\n#\n# {}\n#\n".format(node.prompt[0]))
1388 of a node are visited before the next node is visited).
1390 The Kconfig.top_node menu node is skipped. It contains an implicit menu
1396 defined_syms = [node.item for node in kconf.node_iter()
1397 if isinstance(node.item, Symbol)]
1410 node = self.top_node
1412 # Jump to the next node with an iterative tree walk
1413 if node.list:
1414 node = node.list
1415 elif node.next:
1416 node = node.next
1418 while node.parent:
1419 node = node.parent
1420 if node.next:
1421 node = node.next
1427 if unique_syms and isinstance(node.item, Symbol):
1428 if node.item._visited:
1430 node.item._visited = True
1432 yield node
2277 # The parent menu node, corresponding to a menu, Choice, or 'if'.
2281 # The previous menu node. New nodes will be added after this one (by
2286 # to the 'list' pointer to "tilt up" the children above the node.
2288 # Returns the final menu node in the block (or 'prev' if the block is
2306 node = MenuNode()
2307 node.kconfig = self
2308 node.item = sym
2309 node.is_menuconfig = (t0 is _T_MENUCONFIG)
2310 node.prompt = node.help = node.list = None
2311 node.parent = parent
2312 node.filename = self._filename
2313 node.linenr = self._linenr
2314 node.include_path = self._include_path
2316 sym.nodes.append(node)
2318 self._parse_properties(node)
2320 if node.item.env_var:
2321 if node.item.env_var in os.environ:
2322 os.environ[node.item.name] = os.environ[node.item.env_var]
2324 os.environ[node.item.name] = ((node.defaults[0])[0]).name
2326 if node.is_menuconfig and not node.prompt:
2331 prev.next = prev = node
2376 # node and return it.
2381 node = MenuNode()
2382 node.item = node.prompt = None
2383 node.parent = parent
2384 node.filename = self._filename
2385 node.linenr = self._linenr
2387 node.dep = self._expect_expr_and_eol()
2389 self._parse_block(_T_ENDIF, node, node)
2390 node.list = node.next
2392 prev.next = prev = node
2395 node = MenuNode()
2396 node.kconfig = self
2397 node.item = MENU
2398 node.is_menuconfig = True
2399 node.prompt = (self._expect_str_and_eol(), self.y)
2400 node.visibility = self.y
2401 node.parent = parent
2402 node.filename = self._filename
2403 node.linenr = self._linenr
2404 node.include_path = self._include_path
2406 self.menus.append(node)
2408 self._parse_properties(node)
2409 self._parse_block(_T_ENDMENU, node, node)
2410 node.list = node.next
2412 prev.next = prev = node
2415 node = MenuNode()
2416 node.kconfig = self
2417 node.item = COMMENT
2418 node.is_menuconfig = False
2419 node.prompt = (self._expect_str_and_eol(), self.y)
2420 node.list = None
2421 node.parent = parent
2422 node.filename = self._filename
2423 node.linenr = self._linenr
2424 node.include_path = self._include_path
2426 self.comments.append(node)
2428 self._parse_properties(node)
2430 prev.next = prev = node
2452 node = MenuNode()
2453 node.kconfig = self
2454 node.item = choice
2455 node.is_menuconfig = True
2456 node.prompt = node.help = None
2457 node.parent = parent
2458 node.filename = self._filename
2459 node.linenr = self._linenr
2460 node.include_path = self._include_path
2462 choice.nodes.append(node)
2464 self._parse_properties(node)
2465 self._parse_block(_T_ENDCHOICE, node, node)
2466 node.list = node.next
2468 prev.next = prev = node
2478 # End of file reached. Terminate the final node and return it.
2493 def _parse_properties(self, node): argument
2494 # Parses and adds properties to the MenuNode 'node' (type, 'prompt',
2506 # node:
2507 # The menu node we're parsing properties on
2511 node.dep = self.y
2519 self._set_type(node, _TOKEN_TO_TYPE[t0])
2521 self._parse_prompt(node)
2527 node.dep = self._make_and(node.dep,
2531 self._parse_help(node)
2534 if not isinstance(node.item, Symbol):
2537 node.selects.append((self._expect_nonconst_sym(),
2541 if not isinstance(node.item, Symbol):
2544 node.implies.append((self._expect_nonconst_sym(),
2548 node.defaults.append((self._parse_expr(False),
2553 self._set_type(node, _TOKEN_TO_TYPE[t0])
2554 node.defaults.append((self._parse_expr(False),
2558 self._parse_prompt(node)
2561 node.ranges.append((self._expect_sym(),
2571 node.item.env_var = env_var
2574 node.defaults.append(
2580 "set".format(node.item.name, env_var),
2583 if env_var != node.item.name:
2590 .format(node.item.name, env_var),
2595 self.defconfig_list = node.item
2600 node.item.name),
2609 if node.item is not self.modules:
2621 if not isinstance(node.item, Symbol):
2625 node.item.is_allnoconfig_y = True
2634 node.visibility = self._make_and(node.visibility,
2638 if not isinstance(node.item, Choice):
2641 node.item.is_optional = True
2649 def _set_type(self, node, new_type): argument
2650 if node.item.orig_type not in (UNKNOWN, new_type):
2652 .format(_name_and_loc(node.item),
2655 node.item.orig_type = new_type
2657 def _parse_prompt(self, node): argument
2661 if node.prompt:
2662 self._warn(_name_and_loc(node.item) +
2667 self._warn(_name_and_loc(node.item) +
2674 node.prompt = (prompt, self._parse_cond())
2676 def _parse_help(self, node): argument
2679 if node.help is not None:
2680 self._warn(_name_and_loc(node.item) +
2694 self._warn(_name_and_loc(node.item) +
2697 node.help = ""
2704 self._warn(_name_and_loc(node.item) +
2707 node.help = ""
2734 node.help = "\n".join(help_lines).rstrip() + "\n"
2773 # Otherwise, parse the expression on the right and make an OR node.
2783 # Otherwise, parse the right operand and make an AND node. This turns
2843 for node in sym.nodes:
2844 if node.prompt:
2845 _make_depend_on(sym, node.prompt[1])
2878 for node in choice.nodes:
2879 if node.prompt:
2880 _make_depend_on(choice, node.prompt[1])
2918 def _finalize_tree(self, node, visible_if): argument
2926 # node:
2927 # The current "parent" menu node, from which we propagate
2934 if node.list:
2935 # The menu node is a choice, menu, or if. Finalize each child in
2938 if node.item is MENU:
2939 visible_if = self._make_and(visible_if, node.visibility)
2941 # Propagate the menu node's dependencies to each child menu node.
2947 self._propagate_deps(node, visible_if)
2950 cur = node.list
2955 elif isinstance(node.item, Symbol):
2956 # Add the node's non-node-specific properties (defaults, ranges,
2958 self._add_props_to_sc(node)
2961 # finalize each child menu node in that menu if so, like for the
2963 cur = node
2964 while cur.next and _auto_menu_dep(node, cur.next):
2969 cur.parent = node
2971 if cur is not node:
2974 node.list = node.next
2975 node.next = cur.next
2979 if node.list:
2980 # We have a parent node with individually finalized child nodes. Do
2982 _flatten(node.list)
2983 _remove_ifs(node)
2985 # Empty choices (node.list None) are possible, so this needs to go
2987 if isinstance(node.item, Choice):
2988 # Add the node's non-node-specific properties to the choice
2989 self._add_props_to_sc(node)
2990 _finalize_choice(node)
2992 def _propagate_deps(self, node, visible_if): argument
2993 # Propagates 'node's dependencies to its child menu nodes
2995 # If the parent node holds a Choice, we use the Choice itself as the
3002 basedep = node.item if isinstance(node.item, Choice) else node.dep
3004 cur = node.list
3044 def _add_props_to_sc(self, node): argument
3045 # Copies properties from the menu node 'node' up to its contained
3054 sc = node.item
3057 sc.direct_dep = self._make_or(sc.direct_dep, node.dep)
3059 sc.defaults += node.defaults
3063 if node.ranges:
3064 sc.ranges += node.ranges
3066 if node.selects:
3067 sc.selects += node.selects
3070 for target, cond in node.selects:
3075 if node.implies:
3076 sc.implies += node.implies
3080 for target, cond in node.implies:
3153 for node in self.node_iter():
3154 if sym in node.referenced:
3156 .format(node.filename, node.linenr, node)
3311 Symbols defined in multiple locations get one node for each location.
3813 for node in self.nodes:
3814 res |= node.referenced
3829 for node in self.nodes:
3830 if node.prompt:
3831 fields.append('"{}"'.format(node.prompt[0]))
3870 for node in self.nodes:
3871 fields.append("{}:{}".format(node.filename, node.linenr))
3899 return "\n".join(node.custom_str(sc_expr_str_fn)
3900 for node in self.nodes)
4045 for node in self.nodes:
4046 if node.prompt:
4417 for node in self.nodes:
4418 res |= node.referenced
4432 for node in self.nodes:
4433 if node.prompt:
4434 fields.append('"{}"'.format(node.prompt[0]))
4458 for node in self.nodes:
4459 fields.append("{}:{}".format(node.filename, node.linenr))
4478 return "\n".join(node.custom_str(sc_expr_str_fn)
4479 for node in self.nodes)
4582 Represents a menu node in the configuration. This corresponds to an entry
4585 multiple locations, it gets one menu node for each location.
4587 The top-level menu node, corresponding to the implicit top-level menu, is
4604 The following menu node. None if there is no following node.
4607 The first child menu node. None if there are no children.
4614 The parent menu node. None if there is no parent.
4617 A (string, cond) tuple with the prompt for the menu node and its
4626 The 'default' properties for this particular menu node. See
4644 The help text for the menu node for Symbols and Choices. None if there is
4645 no help text. Always stored in the node rather than the Symbol or Choice.
4650 The 'depends on' dependencies for the menu node, or self.kconfig.y if
4660 The 'visible if' dependencies for the menu node (which must represent a
4667 property conditions of the menu node.
4673 Set to True if the children of the menu node should be displayed in a
4676 - Menus (node.item == MENU)
4684 'is_menuconfig' is just a hint on how to display the menu node. It's
4688 The location where the menu node appears. The filename is relative to
4694 'source' statements via which the Kconfig file containing this menu node
4698 Note that the Kconfig file of the menu node itself isn't included. Check
4702 The Kconfig instance the menu node is from.
4727 # Properties defined on this particular menu node. A local 'depends on'
4771 Returns a string with information about the menu node when it is
4777 fields.append("menu node for symbol " + self.item.name)
4780 s = "menu node for choice"
4786 fields.append("menu node for menu")
4789 fields.append("menu node for comment")
4792 fields.append("menu node for if (should not appear in the final "
4827 Returns a string representation of the menu node, matching the Kconfig
4831 the object associated with the menu node. See the module documentation
4836 node are shown on all menu nodes ('option env=...', 'optional' for
5223 for node in sc.nodes:
5224 if node.prompt:
5225 vis = max(vis, expr_value(node.prompt[1]))
5371 ", ".join("{}:{}".format(node.filename, node.linenr)
5372 for node in sc.nodes))
5409 # If node2 has no prompt, use its menu node dependencies instead
5413 def _flatten(node): argument
5424 while node:
5425 if node.list and not node.prompt and \
5426 not isinstance(node.item, Choice):
5428 last_node = node.list
5430 last_node.parent = node.parent
5435 last_node.next = node.next
5436 node.next = node.list
5437 node.list = None
5439 node = node.next
5441 def _remove_ifs(node): argument
5447 first = node.list
5457 node.list = first
5459 def _finalize_choice(node): argument
5460 # Finalizes a choice, marking each symbol whose menu node has the choice as
5464 choice = node.item
5466 cur = node.list
5742 for node in choice.nodes:
5743 if node.prompt:
5772 for node in sym.nodes:
5773 if node.parent.item is choice:
5774 if not node.prompt:
5778 elif node.prompt: