FV3 Bundle
cpplint.NestingState Class Reference
Inheritance diagram for cpplint.NestingState:
[legend]
Collaboration diagram for cpplint.NestingState:
[legend]

Public Member Functions

def __init__ (self)
 
def SeenOpenBrace (self)
 
def InNamespaceBody (self)
 
def InExternC (self)
 
def InClassDeclaration (self)
 
def InAsmBlock (self)
 
def InTemplateArgumentList (self, clean_lines, linenum, pos)
 
def UpdatePreprocessor (self, line)
 
def Update (self, filename, clean_lines, linenum, error)
 
def InnermostClass (self)
 
def CheckCompletedBlocks (self, filename, error)
 
def __init__ (self)
 
def SeenOpenBrace (self)
 
def InNamespaceBody (self)
 
def InExternC (self)
 
def InClassDeclaration (self)
 
def InAsmBlock (self)
 
def InTemplateArgumentList (self, clean_lines, linenum, pos)
 
def UpdatePreprocessor (self, line)
 
def Update (self, filename, clean_lines, linenum, error)
 
def InnermostClass (self)
 
def CheckCompletedBlocks (self, filename, error)
 
def __init__ (self)
 
def SeenOpenBrace (self)
 
def InNamespaceBody (self)
 
def InExternC (self)
 
def InClassDeclaration (self)
 
def InAsmBlock (self)
 
def InTemplateArgumentList (self, clean_lines, linenum, pos)
 
def UpdatePreprocessor (self, line)
 
def Update (self, filename, clean_lines, linenum, error)
 
def InnermostClass (self)
 
def CheckCompletedBlocks (self, filename, error)
 

Public Attributes

 stack
 
 previous_stack_top
 
 pp_stack
 

Detailed Description

Holds states related to parsing braces.

Definition at line 2515 of file ioda/tools/cpplint.py.

Constructor & Destructor Documentation

◆ __init__() [1/3]

def cpplint.NestingState.__init__ (   self)

Definition at line 2518 of file ioda/tools/cpplint.py.

Here is the caller graph for this function:

◆ __init__() [2/3]

def cpplint.NestingState.__init__ (   self)

Definition at line 2518 of file oops/tools/cpplint.py.

Here is the call graph for this function:

◆ __init__() [3/3]

def cpplint.NestingState.__init__ (   self)

Definition at line 2518 of file ufo/tools/cpplint.py.

Here is the call graph for this function:

Member Function Documentation

◆ CheckCompletedBlocks() [1/3]

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 2867 of file ioda/tools/cpplint.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CheckCompletedBlocks() [2/3]

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 2867 of file oops/tools/cpplint.py.

Here is the call graph for this function:

◆ CheckCompletedBlocks() [3/3]

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 2867 of file ufo/tools/cpplint.py.

Here is the call graph for this function:

◆ InAsmBlock() [1/3]

def cpplint.NestingState.InAsmBlock (   self)
Check if we are currently one level inside an inline ASM block.

Returns:
  True if the top of the stack is a block containing inline ASM.

Definition at line 2574 of file ioda/tools/cpplint.py.

Here is the caller graph for this function:

◆ InAsmBlock() [2/3]

def cpplint.NestingState.InAsmBlock (   self)
Check if we are currently one level inside an inline ASM block.

Returns:
  True if the top of the stack is a block containing inline ASM.

Definition at line 2574 of file ufo/tools/cpplint.py.

Here is the call graph for this function:

◆ InAsmBlock() [3/3]

def cpplint.NestingState.InAsmBlock (   self)
Check if we are currently one level inside an inline ASM block.

Returns:
  True if the top of the stack is a block containing inline ASM.

Definition at line 2574 of file oops/tools/cpplint.py.

Here is the call graph for this function:

◆ InClassDeclaration() [1/3]

def cpplint.NestingState.InClassDeclaration (   self)
Check if we are currently one level inside a class or struct declaration.

Returns:
  True if top of the stack is a class/struct, False otherwise.

Definition at line 2566 of file ioda/tools/cpplint.py.

Here is the caller graph for this function:

◆ InClassDeclaration() [2/3]

def cpplint.NestingState.InClassDeclaration (   self)
Check if we are currently one level inside a class or struct declaration.

Returns:
  True if top of the stack is a class/struct, False otherwise.

Definition at line 2566 of file ufo/tools/cpplint.py.

Here is the call graph for this function:

◆ InClassDeclaration() [3/3]

def cpplint.NestingState.InClassDeclaration (   self)
Check if we are currently one level inside a class or struct declaration.

Returns:
  True if top of the stack is a class/struct, False otherwise.

Definition at line 2566 of file oops/tools/cpplint.py.

Here is the call graph for this function:

◆ InExternC() [1/3]

def cpplint.NestingState.InExternC (   self)
Check if we are currently one level inside an 'extern "C"' block.

Returns:
  True if top of the stack is an extern block, False otherwise.

Definition at line 2558 of file oops/tools/cpplint.py.

Here is the call graph for this function:

◆ InExternC() [2/3]

def cpplint.NestingState.InExternC (   self)
Check if we are currently one level inside an 'extern "C"' block.

Returns:
  True if top of the stack is an extern block, False otherwise.

Definition at line 2558 of file ioda/tools/cpplint.py.

Here is the caller graph for this function:

◆ InExternC() [3/3]

def cpplint.NestingState.InExternC (   self)
Check if we are currently one level inside an 'extern "C"' block.

Returns:
  True if top of the stack is an extern block, False otherwise.

Definition at line 2558 of file ufo/tools/cpplint.py.

Here is the call graph for this function:

◆ InNamespaceBody() [1/3]

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 2550 of file ufo/tools/cpplint.py.

Here is the call graph for this function:

◆ InNamespaceBody() [2/3]

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 2550 of file ioda/tools/cpplint.py.

Here is the caller graph for this function:

◆ InNamespaceBody() [3/3]

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 2550 of file oops/tools/cpplint.py.

Here is the call graph for this function:

◆ InnermostClass() [1/3]

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 2855 of file ioda/tools/cpplint.py.

Here is the caller graph for this function:

◆ InnermostClass() [2/3]

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 2855 of file oops/tools/cpplint.py.

Here is the call graph for this function:

◆ InnermostClass() [3/3]

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 2855 of file ufo/tools/cpplint.py.

Here is the call graph for this function:

◆ InTemplateArgumentList() [1/3]

def cpplint.NestingState.InTemplateArgumentList (   self,
  clean_lines,
  linenum,
  pos 
)
Check if current position is inside template argument list.

Args:
  clean_lines: A CleansedLines instance containing the file.
  linenum: The number of the line to check.
  pos: position just after the suspected template argument.
Returns:
  True if (linenum, pos) is inside template arguments.

Definition at line 2582 of file oops/tools/cpplint.py.

Here is the call graph for this function:

◆ InTemplateArgumentList() [2/3]

def cpplint.NestingState.InTemplateArgumentList (   self,
  clean_lines,
  linenum,
  pos 
)
Check if current position is inside template argument list.

Args:
  clean_lines: A CleansedLines instance containing the file.
  linenum: The number of the line to check.
  pos: position just after the suspected template argument.
Returns:
  True if (linenum, pos) is inside template arguments.

Definition at line 2582 of file ufo/tools/cpplint.py.

Here is the call graph for this function:

◆ InTemplateArgumentList() [3/3]

def cpplint.NestingState.InTemplateArgumentList (   self,
  clean_lines,
  linenum,
  pos 
)
Check if current position is inside template argument list.

Args:
  clean_lines: A CleansedLines instance containing the file.
  linenum: The number of the line to check.
  pos: position just after the suspected template argument.
Returns:
  True if (linenum, pos) is inside template arguments.

Definition at line 2582 of file ioda/tools/cpplint.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SeenOpenBrace() [1/3]

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 2541 of file ioda/tools/cpplint.py.

Here is the caller graph for this function:

◆ SeenOpenBrace() [2/3]

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 2541 of file ufo/tools/cpplint.py.

Here is the call graph for this function:

◆ SeenOpenBrace() [3/3]

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 2541 of file oops/tools/cpplint.py.

Here is the call graph for this function:

◆ Update() [1/3]

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 2691 of file ioda/tools/cpplint.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Update() [2/3]

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 2691 of file ufo/tools/cpplint.py.

Here is the call graph for this function:

◆ Update() [3/3]

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 2691 of file oops/tools/cpplint.py.

Here is the call graph for this function:

◆ UpdatePreprocessor() [1/3]

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 2634 of file ufo/tools/cpplint.py.

Here is the call graph for this function:

◆ UpdatePreprocessor() [2/3]

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 2634 of file oops/tools/cpplint.py.

Here is the call graph for this function:

◆ UpdatePreprocessor() [3/3]

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 2634 of file ioda/tools/cpplint.py.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ pp_stack

cpplint.NestingState.pp_stack

Definition at line 2539 of file ioda/tools/cpplint.py.

◆ previous_stack_top

cpplint.NestingState.previous_stack_top

Definition at line 2536 of file ioda/tools/cpplint.py.

◆ stack

cpplint.NestingState.stack

Definition at line 2525 of file ioda/tools/cpplint.py.


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