fparser Reference Guide  0.0.14
fparser.two.C99Preprocessor.Cpp_Elif_Stmt Class Reference
Inheritance diagram for fparser.two.C99Preprocessor.Cpp_Elif_Stmt:
Collaboration diagram for fparser.two.C99Preprocessor.Cpp_Elif_Stmt:

Public Member Functions

def tostr (self)
 
- Public Member Functions inherited from fparser.two.utils.WORDClsBase
def tostr (self)
 
def tostr_a (self)
 
- Public Member Functions inherited from fparser.two.utils.Base
def __init__ (self, string, parent_cls=None)
 
def __new__ (cls, string, parent_cls=None)
 
def get_root (self)
 
def children (self)
 
def init (self, items)
 
def torepr (self)
 
def __str__ (self)
 
def __repr__ (self)
 
def tofortran (self, tab="", isfix=None)
 
def restore_reader (self, reader)
 
- Public Member Functions inherited from fparser.two.utils.ComparableMixin
def __lt__ (self, other)
 
def __le__ (self, other)
 
def __eq__ (self, other)
 
def __ge__ (self, other)
 
def __gt__ (self, other)
 
def __ne__ (self, other)
 

Static Public Member Functions

def match (string)
 
- Static Public Member Functions inherited from fparser.two.utils.WORDClsBase
def match (keyword, cls, string, colons=False, require_cls=False)
 

Static Public Attributes

 subclass_names
 
 use_names
 
 value
 
- Static Public Attributes inherited from fparser.two.utils.Base
 subclasses
 

Additional Inherited Members

- Public Attributes inherited from fparser.two.utils.Base
 parent
 
 items
 

Detailed Description

C99 6.10.1 Conditional inclusion

elif-stmt is  # elif constant-expression new-line

Definition at line 214 of file C99Preprocessor.py.

Member Function Documentation

◆ match()

def fparser.two.C99Preprocessor.Cpp_Elif_Stmt.match (   string)
static
Implements the matching for an elif preprocessor directive.

:param str string: the string to match with as an elif statement.

:return: a tuple of size 2 containing the statements keyword and \
  right hand side, or `None` if there is no match.
:rtype: \
    (`str`, :py:class:`fparser.two.C99_Preprocessor.Cpp_Pp_Tokens`) \
    or `NoneType`

Definition at line 228 of file C99Preprocessor.py.

228  def match(string):
229  """Implements the matching for an elif preprocessor directive.
230 
231  :param str string: the string to match with as an elif statement.
232 
233  :return: a tuple of size 2 containing the statements keyword and \
234  right hand side, or `None` if there is no match.
235  :rtype: \
236  (`str`, :py:class:`fparser.two.C99_Preprocessor.Cpp_Pp_Tokens`) \
237  or `NoneType`
238 
239  """
240  if not string:
241  return None
242  return WORDClsBase.match(
243  Cpp_Elif_Stmt._pattern,
244  Cpp_Pp_Tokens,
245  string,
246  colons=False,
247  require_cls=True,
248  )
249 
Here is the caller graph for this function:

◆ tostr()

def fparser.two.C99Preprocessor.Cpp_Elif_Stmt.tostr (   self)
:return: this elif-stmt as a string.
:rtype: str

Definition at line 250 of file C99Preprocessor.py.

References fparser.two.Fortran2003.Comment.items, fparser.one.statements.StatementWithNamelist.items, fparser.one.statements.Assign.items, fparser.one.statements.Call.items, fparser.one.statements.ComputedGoto.items, fparser.one.statements.AssignedGoto.items, fparser.two.utils.Base.items, fparser.one.statements.Print.items, fparser.one.statements.Read0.items, fparser.one.statements.Read1.items, fparser.one.typedecl_statements.Implicit.items, fparser.one.statements.Write.items, fparser.one.statements.Allocate.items, fparser.one.statements.Deallocate.items, fparser.one.statements.ModuleProcedure.items, fparser.one.statements.Access.items, fparser.one.statements.Save.items, fparser.one.statements.Nullify.items, fparser.one.statements.Use.items, fparser.one.statements.Parameter.items, fparser.one.statements.Equivalence.items, fparser.one.statements.Dimension.items, fparser.one.statements.Target.items, fparser.one.statements.Pointer.items, fparser.one.statements.Inquire.items, fparser.one.statements.Namelist.items, fparser.one.statements.Common.items, fparser.one.statements.Intent.items, fparser.one.statements.Entry.items, fparser.one.statements.GenericBinding.items, fparser.one.statements.Allocatable.items, fparser.one.statements.Bind.items, fparser.one.statements.Case.items, fparser.one.statements.TypeIs.items, fparser.one.statements.ClassIs.items, fparser.one.statements.Enumerator.items, and fparser.one.statements.Depend.items.

250  def tostr(self):
251  """
252  :return: this elif-stmt as a string.
253  :rtype: str
254  """
255  return "{0} {1}".format(*self.items)
256 
257 
Here is the caller graph for this function:

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