Lines Matching refs:stack

438     'stack.h',
488 'stack',
2002 def FindEndOfExpressionInLine(line, startpos, stack):
2008 stack: nesting stack at startpos.
2013 Otherwise: (-1, new stack at end of this line)
2018 # Found start of parenthesized expression, push to expression stack
2019 stack.append(char)
2024 if stack and stack[-1] == '<':
2025 stack.pop()
2026 if not stack:
2029 # operator<, don't add to stack
2033 stack.append('<')
2038 # must have been an operator. Remove them from expression stack.
2039 while stack and stack[-1] == '<':
2040 stack.pop()
2041 if not stack:
2043 if ((stack[-1] == '(' and char == ')') or
2044 (stack[-1] == '[' and char == ']') or
2045 (stack[-1] == '{' and char == '}')):
2046 stack.pop()
2047 if not stack:
2060 # Pop the stack if there is a matching '<'. Otherwise, ignore
2062 if stack:
2063 if stack[-1] == '<':
2064 stack.pop()
2065 if not stack:
2071 while stack and stack[-1] == '<':
2072 stack.pop()
2073 if not stack:
2077 return (-1, stack)
2108 (end_pos, stack) = FindEndOfExpressionInLine(line, pos, [])
2113 while stack and linenum < clean_lines.NumLines() - 1:
2116 (end_pos, stack) = FindEndOfExpressionInLine(line, 0, stack)
2124 def FindStartOfExpressionInLine(line, endpos, stack):
2133 stack: nesting stack at endpos.
2138 Otherwise: (-1, new stack at beginning of this line)
2144 # Found end of expression, push to expression stack
2145 stack.append(char)
2156 stack.append('>')
2163 # If there is a matching '>', we can pop the expression stack.
2165 if stack and stack[-1] == '>':
2166 stack.pop()
2167 if not stack:
2172 # If there are any unmatched '>' on the stack, they must be
2174 while stack and stack[-1] == '>':
2175 stack.pop()
2176 if not stack:
2178 if ((char == '(' and stack[-1] == ')') or
2179 (char == '[' and stack[-1] == ']') or
2180 (char == '{' and stack[-1] == '}')):
2181 stack.pop()
2182 if not stack:
2191 while stack and stack[-1] == '>':
2192 stack.pop()
2193 if not stack:
2198 return (-1, stack)
2223 (start_pos, stack) = FindStartOfExpressionInLine(line, pos, [])
2228 while stack and linenum > 0:
2231 (start_pos, stack) = FindStartOfExpressionInLine(line, len(line) - 1, stack)
2893 # The entire nesting stack before #if
2896 # The entire nesting stack up to #else
2913 self.stack = []
2915 # Top of the previous stack before each Update().
2920 # saving the previous top of nesting stack.
2922 # We could save the full stack, but we only need the top. Copying
2923 # the full nesting stack would slow down cpplint by ~10%.
2936 return (not self.stack) or self.stack[-1].seen_open_brace
2942 True if top of the stack is a namespace block, False otherwise.
2944 return self.stack and isinstance(self.stack[-1], _NamespaceInfo)
2950 True if top of the stack is an extern block, False otherwise.
2952 return self.stack and isinstance(self.stack[-1], _ExternCInfo)
2958 True if top of the stack is a class/struct, False otherwise.
2960 return self.stack and isinstance(self.stack[-1], _ClassInfo)
2966 True if the top of the stack is a block containing inline ASM.
2968 return self.stack and self.stack[-1].inline_asm != _NO_ASM
3023 """Update preprocessor stack.
3038 these do not affect nesting stack.
3044 # Beginning of #if block, save the nesting stack here. The saved
3045 # stack will allow us to restore the parsing state in the #else case.
3046 self.pp_stack.append(_PreprocessorInfo(copy.deepcopy(self.stack)))
3052 # whole nesting stack up to this point. This is what we
3055 self.pp_stack[-1].stack_before_else = copy.deepcopy(self.stack)
3057 # Restore the stack to how it was before the #if
3058 self.stack = copy.deepcopy(self.pp_stack[-1].stack_before_if)
3066 # stack to its former state before the #else, otherwise we
3071 self.stack = self.pp_stack[-1].stack_before_else
3090 # Remember top of the previous nesting stack.
3092 # The stack is always pushed/popped and not modified in place, so
3095 if self.stack:
3096 self.previous_stack_top = self.stack[-1]
3104 # the nesting stack.
3105 if self.stack:
3106 inner_block = self.stack[-1]
3139 self.stack.append(new_namespace)
3156 (not self.stack or self.stack[-1].open_parentheses == 0)):
3168 self.stack.append(_ClassInfo(
3176 self.stack[-1].CheckBegin(filename, clean_lines, linenum, error)
3179 if self.stack and isinstance(self.stack[-1], _ClassInfo):
3180 classinfo = self.stack[-1]
3215 # stack otherwise.
3217 self.stack[-1].seen_open_brace = True
3219 self.stack.append(_ExternCInfo(linenum))
3221 self.stack.append(_BlockInfo(linenum, True))
3223 self.stack[-1].inline_asm = _BLOCK_ASM
3228 # the stack for these.
3233 # Also pop these stack for these.
3235 self.stack.pop()
3237 # Perform end of block checks and pop the stack.
3238 if self.stack:
3239 self.stack[-1].CheckEnd(filename, clean_lines, linenum, error)
3240 self.stack.pop()
3244 """Get class info on the top of the stack.
3249 for i in range(len(self.stack), 0, -1):
3250 classinfo = self.stack[i - 1]
3266 for obj in self.stack:
3301 the current stack of nested blocks being parsed.
3362 # Return early if the top of the nesting stack is not a class, or if
3537 len(nesting_state.stack) > 1 and
3538 nesting_state.stack[-1].check_namespace_indentation and
3540 nesting_state.previous_stack_top == nesting_state.stack[-2])
3687 the current stack of nested blocks being parsed.
3997 the current stack of nested blocks being parsed.
4014 # stack until we find something that resembles a typename
4018 block_index = len(nesting_state.stack) - 1
4020 if isinstance(nesting_state.stack[block_index], _NamespaceInfo):
4029 last_line = nesting_state.stack[block_index].starting_linenum
4033 next_block_start = nesting_state.stack[block_index - 1].starting_linenum
4062 the current stack of nested blocks being parsed.
4253 # to control the lifetime of stack-allocated variables. Braces are also
4827 the current stack of nested blocks being parsed.
5245 the current stack of nested blocks being parsed.
5574 the current stack of nested blocks being parsed.
5921 ('<stack>', ('stack',)),
6293 return len(nesting_state.stack) >= 1 and (
6294 isinstance(nesting_state.stack[-1], _NamespaceInfo))
6297 return (len(nesting_state.stack) > 1 and
6298 nesting_state.stack[-1].check_namespace_indentation and
6299 isinstance(nesting_state.stack[-2], _NamespaceInfo))
6308 is_namespace_indent_item: If we just put a new class on the stack, True.
6309 If the top of the stack is not a class, or we did not recently
6357 the current stack of nested blocks being parsed.