fparser Reference Guide  0.0.14
fparser.two.Fortran2003.Connect_Spec Class Reference
Inheritance diagram for fparser.two.Fortran2003.Connect_Spec:
Collaboration diagram for fparser.two.Fortran2003.Connect_Spec:

Static Public Member Functions

def match (string)
 

Static Public Attributes

 subclass_names
 
 use_names
 

Detailed Description

R905
<connect-spec> = [ UNIT = ] <file-unit-number>
                 | ACCESS = <scalar-default-char-expr>
                 | ACTION = <scalar-default-char-expr>
                 | ASYNCHRONOUS = <scalar-default-char-expr>
                 | BLANK = <scalar-default-char-expr>
                 | DECIMAL = <scalar-default-char-expr>
                 | DELIM = <scalar-default-char-expr>
                 | ENCODING = <scalar-default-char-expr>
                 | ERR = <label>
                 | FILE = <file-name-expr>
                 | FORM = <scalar-default-char-expr>
                 | IOMSG = <iomsg-variable>
                 | IOSTAT = <scalar-int-variable>
                 | PAD = <scalar-default-char-expr>
                 | POSITION = <scalar-default-char-expr>
                 | RECL = <scalar-int-expr>
                 | ROUND = <scalar-default-char-expr>
                 | SIGN = <scalar-default-char-expr>
                 | STATUS = <scalar-default-char-expr>

Definition at line 7813 of file Fortran2003.py.

Member Function Documentation

◆ match()

def fparser.two.Fortran2003.Connect_Spec.match (   string)
static
:param str string: Fortran code to check for a match
:return: 2-tuple containing the keyword and value or None if the
 supplied string is not a match
:rtype: 2-tuple containing keyword (e.g. "UNIT") and associated value

Definition at line 7849 of file Fortran2003.py.

7849  def match(string):
7850  """
7851  :param str string: Fortran code to check for a match
7852  :return: 2-tuple containing the keyword and value or None if the
7853  supplied string is not a match
7854  :rtype: 2-tuple containing keyword (e.g. "UNIT") and associated value
7855  """
7856  if "=" not in string:
7857  # The only argument which need not be named is the unit number
7858  return "UNIT", File_Unit_Number(string)
7859  # We have a keyword-value pair. Check whether it is valid...
7860  for (keyword, value) in [
7861  (
7862  [
7863  "ACCESS",
7864  "ACTION",
7865  "ASYNCHRONOUS",
7866  "BLANK",
7867  "DECIMAL",
7868  "DELIM",
7869  "ENCODING",
7870  "FORM",
7871  "PAD",
7872  "POSITION",
7873  "ROUND",
7874  "SIGN",
7875  "STATUS",
7876  ],
7877  Scalar_Default_Char_Expr,
7878  ),
7879  ("ERR", Label),
7880  ("FILE", File_Name_Expr),
7881  ("IOSTAT", Scalar_Int_Variable),
7882  ("IOMSG", Iomsg_Variable),
7883  ("RECL", Scalar_Int_Expr),
7884  ("UNIT", File_Unit_Number),
7885  ]:
7886  try:
7887  obj = KeywordValueBase.match(keyword, value, string, upper_lhs=True)
7888  except NoMatchError:
7889  obj = None
7890  if obj is not None:
7891  return obj
7892  return None
7893 
7894 
Here is the caller graph for this function:

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