def build_remap_symbols(self, name_generator, children_only=True):
if not children_only:<EOL><INDENT>replacement = name_generator(skip=(self._reserved_symbols))<EOL>for symbol, c in reversed(sorted(<EOL>self.referenced_symbols.items(), key=itemgetter(<NUM_LIT:1>, <NUM_LIT:0>))):<EOL><INDENT>if symbol not in self.local_declared_symbols:<EOL><INDENT>continue<EOL><DEDENT>self.remapped_symbols[symbol] = next(replacement)<EOL><DEDENT><DEDENT>for child in self.children:<EOL><INDENT>child.build_remap_symbols(name_generator, False)<EOL><DEDENT>
This builds the replacement table for all the defined symbols
for all the children, and this scope, if the children_only
argument is False.