fparser Reference Guide  0.0.14
fparser.two.C99Preprocessor.Cpp_Undef_Stmt Class Reference
Inheritance diagram for fparser.two.C99Preprocessor.Cpp_Undef_Stmt:
Collaboration diagram for fparser.two.C99Preprocessor.Cpp_Undef_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

Implements the matching of a preprocessor undef statement for a macro.

undef-stmt is # undef identifier new-line

Strictly, this is part of 6.10.3 but since it is identified by a different
directive keyword (undef instead of define) we treat it separately.

Definition at line 561 of file C99Preprocessor.py.

Member Function Documentation

◆ match()

def fparser.two.C99Preprocessor.Cpp_Undef_Stmt.match (   string)
static
Implements the matching for a preprocessor undef statement
for a macro. The macro identifier is matched using
:py:class:`fparser.two.C99Preprocessor.Cpp_Macro_Identifier`.

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

:return: a tuple of size 1 containing the macro identifier, or\
  `None` if there is no match.
:rtype: (py:class:`fparser.two.C99Preprocessor.Cpp_Macro_Identifier`) \
or `NoneType`

Definition at line 578 of file C99Preprocessor.py.

578  def match(string):
579  """Implements the matching for a preprocessor undef statement
580  for a macro. The macro identifier is matched using
581  :py:class:`fparser.two.C99Preprocessor.Cpp_Macro_Identifier`.
582 
583  :param str string: the string to match with as an if statement.
584 
585  :return: a tuple of size 1 containing the macro identifier, or\
586  `None` if there is no match.
587  :rtype: (py:class:`fparser.two.C99Preprocessor.Cpp_Macro_Identifier`) \
588  or `NoneType`
589 
590  """
591  if not string:
592  return None
593  return WORDClsBase.match(
594  Cpp_Undef_Stmt._pattern,
595  Cpp_Macro_Identifier,
596  string,
597  colons=False,
598  require_cls=True,
599  )
600 
Here is the caller graph for this function:

◆ tostr()

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

Definition at line 601 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.

601  def tostr(self):
602  """
603  :return: this undef-stmt as a string.
604  :rtype: str
605  """
606  return "{0} {1}".format(*self.items)
607 
608 
Here is the caller graph for this function:

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