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

Not actually part of C99 but supported by most preprocessors and
with syntax identical to Cpp_Error_Stmt

warning-stmt is # warning [pp-tokens] new-line

Definition at line 699 of file C99Preprocessor.py.

Member Function Documentation

◆ match()

def fparser.two.C99Preprocessor.Cpp_Warning_Stmt.match (   string)
static
Implements the matching for a warning preprocessor directive.
The optional right hand side of the directive is not matched any
further but simply kept as a string.

:param str string: the string to match with as a line statement.

:return: an empty tuple or a tuple of size  1 with the right hand \
  side as a string, or `None` if there is no match.
:rtype: () or (`str`) or `NoneType`

Definition at line 714 of file C99Preprocessor.py.

714  def match(string):
715  """Implements the matching for a warning preprocessor directive.
716  The optional right hand side of the directive is not matched any
717  further but simply kept as a string.
718 
719  :param str string: the string to match with as a line statement.
720 
721  :return: an empty tuple or a tuple of size 1 with the right hand \
722  side as a string, or `None` if there is no match.
723  :rtype: () or (`str`) or `NoneType`
724 
725  """
726  if not string:
727  return None
728  return WORDClsBase.match(
729  Cpp_Warning_Stmt._pattern,
730  Cpp_Pp_Tokens,
731  string,
732  colons=False,
733  require_cls=False,
734  )
735 
Here is the caller graph for this function:

◆ tostr()

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

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

736  def tostr(self):
737  """
738  :return: this warning-stmt as a string.
739  :rtype: str
740  """
741  if self.items[1]:
742  return "{0} {1}".format(*self.items)
743  return self.items[0]
744 
745 
746 # 6.10.6 Pragma directive
747 # Pragma Preprocessor directives not implemented since Fortran has its own
748 # Pragma syntax in the form of comments. For that reason, most preprocessors
749 # do not support C preprocess pragmas in Fortran code either.
750 
751 
Here is the caller graph for this function:

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