Lines Matching refs:stack

1514 def FindEndOfExpressionInLine(line, startpos, stack):  argument
1531 stack.append(char)
1536 if stack and stack[-1] == '<':
1537 stack.pop()
1538 if not stack:
1545 stack.append('<')
1551 while stack and stack[-1] == '<':
1552 stack.pop()
1553 if not stack:
1555 if ((stack[-1] == '(' and char == ')') or
1556 (stack[-1] == '[' and char == ']') or
1557 (stack[-1] == '{' and char == '}')):
1558 stack.pop()
1559 if not stack:
1574 if stack:
1575 if stack[-1] == '<':
1576 stack.pop()
1577 if not stack:
1583 while stack and stack[-1] == '<':
1584 stack.pop()
1585 if not stack:
1589 return (-1, stack)
1620 (end_pos, stack) = FindEndOfExpressionInLine(line, pos, [])
1625 while stack and linenum < clean_lines.NumLines() - 1:
1628 (end_pos, stack) = FindEndOfExpressionInLine(line, 0, stack)
1636 def FindStartOfExpressionInLine(line, endpos, stack): argument
1657 stack.append(char)
1668 stack.append('>')
1677 if stack and stack[-1] == '>':
1678 stack.pop()
1679 if not stack:
1686 while stack and stack[-1] == '>':
1687 stack.pop()
1688 if not stack:
1690 if ((char == '(' and stack[-1] == ')') or
1691 (char == '[' and stack[-1] == ']') or
1692 (char == '{' and stack[-1] == '}')):
1693 stack.pop()
1694 if not stack:
1703 while stack and stack[-1] == '>':
1704 stack.pop()
1705 if not stack:
1710 return (-1, stack)
1735 (start_pos, stack) = FindStartOfExpressionInLine(line, pos, [])
1740 while stack and linenum > 0:
1743 (start_pos, stack) = FindStartOfExpressionInLine(line, len(line) - 1, stack)
2411 self.stack = []
2434 return (not self.stack) or self.stack[-1].seen_open_brace
2442 return self.stack and isinstance(self.stack[-1], _NamespaceInfo)
2450 return self.stack and isinstance(self.stack[-1], _ExternCInfo)
2458 return self.stack and isinstance(self.stack[-1], _ClassInfo)
2466 return self.stack and self.stack[-1].inline_asm != _NO_ASM
2544 self.pp_stack.append(_PreprocessorInfo(copy.deepcopy(self.stack)))
2553 self.pp_stack[-1].stack_before_else = copy.deepcopy(self.stack)
2556 self.stack = copy.deepcopy(self.pp_stack[-1].stack_before_if)
2569 self.stack = self.pp_stack[-1].stack_before_else
2593 if self.stack:
2594 self.previous_stack_top = self.stack[-1]
2603 if self.stack:
2604 inner_block = self.stack[-1]
2637 self.stack.append(new_namespace)
2654 (not self.stack or self.stack[-1].open_parentheses == 0)):
2666 self.stack.append(_ClassInfo(
2674 self.stack[-1].CheckBegin(filename, clean_lines, linenum, error)
2677 if self.stack and isinstance(self.stack[-1], _ClassInfo):
2678 classinfo = self.stack[-1]
2715 self.stack[-1].seen_open_brace = True
2717 self.stack.append(_ExternCInfo(linenum))
2719 self.stack.append(_BlockInfo(linenum, True))
2721 self.stack[-1].inline_asm = _BLOCK_ASM
2733 self.stack.pop()
2736 if self.stack:
2737 self.stack[-1].CheckEnd(filename, clean_lines, linenum, error)
2738 self.stack.pop()
2747 for i in range(len(self.stack), 0, -1):
2748 classinfo = self.stack[i - 1]
2764 for obj in self.stack:
3030 len(nesting_state.stack) > 1 and
3031 nesting_state.stack[-1].check_namespace_indentation and
3033 nesting_state.previous_stack_top == nesting_state.stack[-2])
3510 block_index = len(nesting_state.stack) - 1
3512 if isinstance(nesting_state.stack[block_index], _NamespaceInfo):
3521 last_line = nesting_state.stack[block_index].starting_linenum
3525 next_block_start = nesting_state.stack[block_index - 1].starting_linenum
5713 if len(nesting_state.stack) >= 1 and (
5714 isinstance(nesting_state.stack[-1], _NamespaceInfo)):
5719 return (len(nesting_state.stack) > 1 and
5720 nesting_state.stack[-1].check_namespace_indentation and
5721 isinstance(nesting_state.stack[-2], _NamespaceInfo))