Reference Guide  2.5.0
psyclone.parse.algorithm.Arg Class Reference

Public Member Functions

def __init__ (self, form, text, varname=None, datatype=None)
 
def __str__ (self)
 
def form (self)
 
def text (self)
 
def varname (self)
 
def varname (self, value)
 
def is_literal (self)
 

Static Public Attributes

list form_options = ["literal", "variable", "indexed_variable", "collection"]
 

Detailed Description

Description of an argument as obtained from parsing kernel or
builtin arguments within invokes in a PSyclone algorithm code.

:param str form: describes whether the argument is a literal \
value, standard variable or indexed variable. Supported options \
are specified in the local form_options list.
:param str text: the original Fortran text of the argument.
:param varname: the extracted variable name from the text if the \
form is not literal otherwise it is set to None. This is optional \
and defaults to None.
:value varname: str or NoneType
:param datatype: a tuple containing information about the datatype \
    and precision of the argument, or None if no information is \
    available. Defaults to None.
:type datatype: (str, str or NoneType) or NoneType

:raises InternalError: if the form argument is not one one of the \
supported types as specified in the local form_options list.

Definition at line 1084 of file algorithm.py.

Member Function Documentation

◆ form()

def psyclone.parse.algorithm.Arg.form (   self)
:returns: a string indicating what type of variable this \
is. Supported options are specified in the local form_options \
list.
:rtype: str

Definition at line 1125 of file algorithm.py.

1125  def form(self):
1126  '''
1127  :returns: a string indicating what type of variable this \
1128  is. Supported options are specified in the local form_options \
1129  list.
1130  :rtype: str
1131 
1132  '''
1133  return self._form
1134 

References psyclone.domain.gocean.kernel.psyir.GOceanKernelMetadata.FieldArg._form, psyclone.domain.gocean.kernel.psyir.GOceanKernelMetadata.ScalarArg._form, psyclone.parse.algorithm.Arg._form, and psyclone.psyGen.Argument._form.

Here is the caller graph for this function:

◆ is_literal()

def psyclone.parse.algorithm.Arg.is_literal (   self)
 Indicates whether this argument is a literal or not.

:returns: True if this argument is a literal and False otherwise.
:rtype: bool

Definition at line 1163 of file algorithm.py.

1163  def is_literal(self):
1164  ''' Indicates whether this argument is a literal or not.
1165 
1166  :returns: True if this argument is a literal and False otherwise.
1167  :rtype: bool
1168 
1169  '''
1170  return self._form == "literal"
1171 
1172 

References psyclone.domain.gocean.kernel.psyir.GOceanKernelMetadata.FieldArg._form, psyclone.domain.gocean.kernel.psyir.GOceanKernelMetadata.ScalarArg._form, psyclone.parse.algorithm.Arg._form, and psyclone.psyGen.Argument._form.

Here is the caller graph for this function:

◆ text()

def psyclone.parse.algorithm.Arg.text (   self)
:returns: the original Fortran text of the argument.
:rtype: str

Definition at line 1136 of file algorithm.py.

1136  def text(self):
1137  '''
1138  :returns: the original Fortran text of the argument.
1139  :rtype: str
1140 
1141  '''
1142  return self._text
1143 

References psyclone.parse.algorithm.Arg._text, and psyclone.psyGen.Argument._text.

◆ varname() [1/2]

def psyclone.parse.algorithm.Arg.varname (   self)
:returns: the extracted variable name from the text if the \
form is not literal and None otherwise
:rtype: str or NoneType

Definition at line 1145 of file algorithm.py.

1145  def varname(self):
1146  '''
1147  :returns: the extracted variable name from the text if the \
1148  form is not literal and None otherwise
1149  :rtype: str or NoneType
1150 
1151  '''
1152  return self._varname
1153 

References psyclone.parse.algorithm.Arg._varname.

Here is the caller graph for this function:

◆ varname() [2/2]

def psyclone.parse.algorithm.Arg.varname (   self,
  value 
)
Allows the setting or re-setting of the variable name value.

:param str value: the new variable name

Definition at line 1155 of file algorithm.py.

1155  def varname(self, value):
1156  '''Allows the setting or re-setting of the variable name value.
1157 
1158  :param str value: the new variable name
1159 
1160  '''
1161  self._varname = value
1162 

References psyclone.parse.algorithm.Arg._varname, and psyclone.parse.algorithm.Arg.varname().

Here is the call graph for this function:

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