Public Member Functions | Public Attributes | List of all members
cpplint._NestingState Class Reference
Inheritance diagram for cpplint._NestingState:
Inheritance graph
[legend]

Public Member Functions

def __init__ (self)
 
def CheckCompletedBlocks (self, filename, error)
 
def InNamespaceBody (self)
 
def InnermostClass (self)
 
def SeenOpenBrace (self)
 
def Update (self, filename, clean_lines, linenum, error)
 
def UpdatePreprocessor (self, line)
 

Public Attributes

 pp_stack
 
 stack
 

Detailed Description

Holds states related to parsing braces.

Definition at line 1808 of file cpplint.py.

Constructor & Destructor Documentation

def cpplint._NestingState.__init__ (   self)

Definition at line 1811 of file cpplint.py.

Member Function Documentation

def cpplint._NestingState.CheckCompletedBlocks (   self,
  filename,
  error 
)
Checks that all classes and namespaces have been completely parsed.

Call this when all lines in a file have been processed.
Args:
  filename: The name of the current file.
  error: The function to call with any errors found.

Definition at line 2064 of file cpplint.py.

def cpplint._NestingState.InNamespaceBody (   self)
Check if we are currently one level inside a namespace body.

Returns:
  True if top of the stack is a namespace block, False otherwise.

Definition at line 1832 of file cpplint.py.

def cpplint._NestingState.InnermostClass (   self)
Get class info on the top of the stack.

Returns:
  A _ClassInfo object if we are inside a class, or None otherwise.

Definition at line 2052 of file cpplint.py.

def cpplint._NestingState.SeenOpenBrace (   self)
Check if we have seen the opening brace for the innermost block.

Returns:
  True if we have seen the opening brace, False if the innermost
  block is still expecting an opening brace.

Definition at line 1823 of file cpplint.py.

def cpplint._NestingState.Update (   self,
  filename,
  clean_lines,
  linenum,
  error 
)
Update nesting state with current line.

Args:
  filename: The name of the current file.
  clean_lines: A CleansedLines instance containing the file.
  linenum: The number of the line to check.
  error: The function to call with any errors found.

Definition at line 1896 of file cpplint.py.

def cpplint._NestingState.UpdatePreprocessor (   self,
  line 
)
Update preprocessor stack.

We need to handle preprocessors due to classes like this:
  #ifdef SWIG
  struct ResultDetailsPageElementExtensionPoint {
  #else
  struct ResultDetailsPageElementExtensionPoint : public Extension {
  #endif

We make the following assumptions (good enough for most files):
- Preprocessor condition evaluates to true from #if up to first
  #else/#elif/#endif.

- Preprocessor condition evaluates to false from #else/#elif up
  to #endif.  We still perform lint checks on these lines, but
  these do not affect nesting stack.

Args:
  line: current line to check.

Definition at line 1840 of file cpplint.py.

Member Data Documentation

cpplint._NestingState.pp_stack

Definition at line 1821 of file cpplint.py.

cpplint._NestingState.stack

Definition at line 1818 of file cpplint.py.


The documentation for this class was generated from the following file:


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:35:27