fparser.one.statements

Fortran single line statements.

Module Contents

Classes

GeneralAssignment

<variable> = <expr>

Assignment

<variable> = <expr>

PointerAssignment

<variable> = <expr>

Assign

ASSIGN <label> TO <int-variable-name>

Call

Call statement class:

Goto

GO TO <label>

ComputedGoto

GO TO ( <label-list> ) [ , ] <scalar-int-expr>

AssignedGoto

GO TO <int-variable-name> [ ( <label> [ , <label> ]... ) ]

Continue

CONTINUE

Return

RETURN [ <scalar-int-expr> ]

Stop

STOP [ <stop-code> ]

Print

Read

Read0: READ ( <io-control-spec-list> ) [ <input-item-list> ]

Read0

Read0: READ ( <io-control-spec-list> ) [ <input-item-list> ]

Read1

Read0: READ ( <io-control-spec-list> ) [ <input-item-list> ]

Write

WRITE ( io-control-spec-list ) [<output-item-list>]

Flush

Wait

Contains

CONTAINS

Allocate

Deallocate

ModuleProcedure

[ MODULE ] PROCEDURE [::] <procedure-name-list>

Access

<access-spec> [ [::] <access-id-list>]

Public

<access-spec> [ [::] <access-id-list>]

Private

<access-spec> [ [::] <access-id-list>]

Close

Cycle

CYCLE [ <do-construct-name> ]

Backspace

REWIND <file-unit-number>

Endfile

REWIND <file-unit-number>

Rewind

REWIND <file-unit-number>

Open

Format

Save

Data

Nullify

NULLIFY ( <pointer-object-list> )

Use

Parses USE statement.

Exit

EXIT [ <do-construct-name> ]

Parameter

PARAMETER ( <named-constant-def-list> )

Equivalence

EQUIVALENCE <equivalence-set-list>

Dimension

DIMENSION [ :: ] <array-name> ( <array-spec> )

Target

TARGET [ :: ] <object-name> ( <array-spec> )

Pointer

Protected

PROTECTED [ :: ] <entity-name-list>

Volatile

VOLATILE [ :: ] <object-name-list>

Value

VALUE [ :: ] <dummy-arg-name-list>

ArithmeticIf

IF ( <scalar-numeric-expr> ) <label> , <label> , <label>

Intrinsic

INTRINSIC [ :: ] <intrinsic-procedure-name-list>

Inquire

INQUIRE ( <inquire-spec-list> )

Sequence

SEQUENCE

External

EXTERNAL [ :: ] <external-name-list>

Namelist

NAMELIST / <namelist-group-name> / <namelist-group-object-list> [ [ , ]

Common

Optional

OPTIONAL [ :: ] <dummy-arg-name-list>

Intent

INTENT ( <intent-spec> ) [ :: ] <dummy-arg-name-list>

Entry

Import

IMPORT [ [ :: ] <import-name-list> ]

SpecificBinding

PROCEDURE [ ( <interface-name> ) ] [ [ , <binding-attr-list> ] :: ]

GenericBinding

GENERIC [ , <access-spec> ] :: <generic-spec> => <binding-name-list>

FinalBinding

FINAL [ :: ] <final-subroutine-name-list>

Allocatable

ALLOCATABLE [ :: ] <object-name> [ ( <deferred-shape-spec-list> ) ]

Asynchronous

ASYNCHRONOUS [ :: ] <object-name-list>

Bind

Else

ELSE [<if-construct-name>]

ElseIf

ELSE IF ( <scalar-logical-expr> ) THEN [ <if-construct-name> ]

Case

Captures a Case statement:

TypeIs

TYPE IS <type-selector> [ <case-construct-name> ]

ClassIs

CLASS <class-selector>

ElseWhere

ELSE WHERE ( <mask-expr> ) [ <where-construct-name> ]

Enumerator

ENUMERATOR [ :: ] <enumerator-list>

FortranName

FORTRANNAME <name>

Threadsafe

THREADSAFE

Depend

DEPEND ( <name-list> ) [ :: ] <dummy-arg-name-list>

Check

CHECK ( <c-int-scalar-expr> ) [ :: ] <name>

CallStatement

CALLSTATEMENT <c-expr>

CallProtoArgument

CALLPROTOARGUMENT <c-type-spec-list>

Pause

PAUSE [ <char-literal-constant|int-literal-constant> ]

Comment

Attributes

Attributes

ForallStmt

WhereStmt

class fparser.one.statements.GeneralAssignment(parent, item)[source]

Bases: fparser.common.base_classes.Statement

<variable> = <expr> <pointer variable> => <expr>

match[source]
item_re[source]
_repr_attr_names[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]
class fparser.one.statements.Assignment(parent, item)[source]

Bases: GeneralAssignment

<variable> = <expr> <pointer variable> => <expr>

class fparser.one.statements.PointerAssignment(parent, item)[source]

Bases: GeneralAssignment

<variable> = <expr> <pointer variable> => <expr>

class fparser.one.statements.Assign(parent, item)[source]

Bases: fparser.common.base_classes.Statement

ASSIGN <label> TO <int-variable-name>

modes = ['fix77'][source]
match[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]
class fparser.one.statements.Call(parent, item)[source]

Bases: fparser.common.base_classes.Statement

Call statement class:

CALL <procedure-designator> [ ( [ <actual-arg-spec-list> ] ) ]

<procedure-designator> = <procedure-name>
                       | <proc-component-ref>
                       | <data-ref> % <binding-name>

<actual-arg-spec> = [ <keyword> = ] <actual-arg>
<actual-arg> = <expr>
             | <variable>
             | <procedure-name>
             | <proc-component-ref>
             | <alt-return-spec>
<alt-return-spec> = * <label>

<proc-component-ref> = <variable> % <procedure-component-name>

<variable> = <designator>
match[source]
process_item()[source]

Parse the string containing the Call and store the designator and list of arguments (if any)

tofortran(isfix=None)[source]

Returns the Fortran representation of this object as a string

analyze()[source]
class fparser.one.statements.Goto(parent, item)[source]

Bases: fparser.common.base_classes.Statement

GO TO <label>

match[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]
class fparser.one.statements.ComputedGoto(parent, item)[source]

Bases: fparser.common.base_classes.Statement

GO TO ( <label-list> ) [ , ] <scalar-int-expr>

match[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]
class fparser.one.statements.AssignedGoto(parent, item)[source]

Bases: fparser.common.base_classes.Statement

GO TO <int-variable-name> [ ( <label> [ , <label> ]… ) ]

modes = ['fix77'][source]
match[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]
class fparser.one.statements.Continue(parent, item)[source]

Bases: fparser.common.base_classes.Statement

CONTINUE

match[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]
class fparser.one.statements.Return(parent, item)[source]

Bases: fparser.common.base_classes.Statement

RETURN [ <scalar-int-expr> ]

match[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]
class fparser.one.statements.Stop(parent, item)[source]

Bases: fparser.common.base_classes.Statement

STOP [ <stop-code> ] <stop-code> = <scalar-char-constant> | <1-5-digit>

match[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]
class fparser.one.statements.Print(parent, item)[source]

Bases: fparser.common.base_classes.Statement

PRINT <format> [, <output-item-list>]
<format> = <default-char-expr> | <label> | *

<output-item> = <expr> | <io-implied-do>
<io-implied-do> = ( <io-implied-do-object-list> , <implied-do-control> )
<io-implied-do-object> = <input-item> | <output-item>
<implied-do-control> = <do-variable>
                     = <scalar-int-expr> ,
                       <scalar-int-expr> [ , <scalar-int-expr> ]
<input-item> = <variable> | <io-implied-do>
match[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]
class fparser.one.statements.Read(parent, item)[source]

Bases: fparser.common.base_classes.Statement

Read0: READ ( <io-control-spec-list> ) [ <input-item-list> ]

<io-control-spec-list> = [ UNIT = ] <io-unit>
[ FORMAT = ] <format>
[ NML = ] <namelist-group-name>
ADVANCE = <scalar-default-char-expr>

Read1: READ <format> [, <input-item-list>]

<format> == <default-char-expr> | <label> | *

match[source]
process_item()[source]
analyze()[source]
class fparser.one.statements.Read0(parent, item)[source]

Bases: Read

Read0: READ ( <io-control-spec-list> ) [ <input-item-list> ]

<io-control-spec-list> = [ UNIT = ] <io-unit>
[ FORMAT = ] <format>
[ NML = ] <namelist-group-name>
ADVANCE = <scalar-default-char-expr>

Read1: READ <format> [, <input-item-list>]

<format> == <default-char-expr> | <label> | *

process_item()[source]
tofortran(isfix=None)[source]
class fparser.one.statements.Read1(parent, item)[source]

Bases: Read

Read0: READ ( <io-control-spec-list> ) [ <input-item-list> ]

<io-control-spec-list> = [ UNIT = ] <io-unit>
[ FORMAT = ] <format>
[ NML = ] <namelist-group-name>
ADVANCE = <scalar-default-char-expr>

Read1: READ <format> [, <input-item-list>]

<format> == <default-char-expr> | <label> | *

process_item()[source]
tofortran(isfix=None)[source]
class fparser.one.statements.Write(parent, item)[source]

Bases: fparser.common.base_classes.Statement

WRITE ( io-control-spec-list ) [<output-item-list>]

match[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]
class fparser.one.statements.Flush(parent, item)[source]

Bases: fparser.common.base_classes.Statement

FLUSH <file-unit-number>
FLUSH ( <flush-spec-list> )
<flush-spec> = [ UNIT = ] <file-unit-number>
             | IOSTAT = <scalar-int-variable>
             | IOMSG = <iomsg-variable>
             | ERR = <label>
match[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]
class fparser.one.statements.Wait(parent, item)[source]

Bases: fparser.common.base_classes.Statement

WAIT ( <wait-spec-list> )
<wait-spec> = [ UNIT = ] <file-unit-number>
            | END = <label>
            | EOR = <label>
            | ERR = <label>
            | ID = <scalar-int-expr>
            | IOMSG = <iomsg-variable>
            | IOSTAT = <scalar-int-variable>
match[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]
class fparser.one.statements.Contains(parent, item)[source]

Bases: fparser.common.base_classes.Statement

CONTAINS

match[source]
process_item()[source]
tofortran(isfix=None)[source]
class fparser.one.statements.Allocate(parent, item)[source]

Bases: fparser.common.base_classes.Statement

ALLOCATE ( [ <type-spec> :: ] <allocation-list> [ , <alloc-opt-list> ] )
<alloc-opt> = STAT = <stat-variable>
            | ERRMSG = <errmsg-variable>
            | SOURCE = <source-expr>
<allocation> = <allocate-object> [ ( <allocate-shape-spec-list> ) ]
match[source]
process_item()[source]

Process the ALLOCATE statement and store the various entities being allocated in self.items. Any type-specification is stored in self.spec.

Raises:

ParseError – if an invalid type-specification is used

tofortran(isfix=None)[source]

Create the Fortran code for this ALLOCATE statement

Parameters:

isfix (bool) – whether or not to generate fixed-format code

Returns:

Fortran code

Return type:

str

analyze()[source]
class fparser.one.statements.Deallocate(parent, item)[source]

Bases: fparser.common.base_classes.Statement

DEALLOCATE ( <allocate-object-list> [ , <dealloc-opt-list> ] )
<allocate-object> = <variable-name>
                  | <structure-component>
<structure-component> = <data-ref>
<dealloc-opt> = STAT = <stat-variable>
                | ERRMSG = <errmsg-variable>
match[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]
class fparser.one.statements.ModuleProcedure(parent, item)[source]

Bases: fparser.common.base_classes.Statement

[ MODULE ] PROCEDURE [::] <procedure-name-list>

match[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]
class fparser.one.statements.Access(parent, item)[source]

Bases: fparser.common.base_classes.Statement

<access-spec> [ [::] <access-id-list>] <access-spec> = PUBLIC | PRIVATE <access-id> = <use-name> | <generic-spec>

match[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]
class fparser.one.statements.Public(parent, item)[source]

Bases: Access

<access-spec> [ [::] <access-id-list>] <access-spec> = PUBLIC | PRIVATE <access-id> = <use-name> | <generic-spec>

is_public = True[source]
class fparser.one.statements.Private(parent, item)[source]

Bases: Access

<access-spec> [ [::] <access-id-list>] <access-spec> = PUBLIC | PRIVATE <access-id> = <use-name> | <generic-spec>

is_public = False[source]
class fparser.one.statements.Close(parent, item)[source]

Bases: fparser.common.base_classes.Statement

CLOSE ( <close-spec-list> )
<close-spec> = [ UNIT = ] <file-unit-number>
               | IOSTAT = <scalar-int-variable>
               | IOMSG = <iomsg-variable>
               | ERR = <label>
               | STATUS = <scalar-default-char-expr>
match[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]
class fparser.one.statements.Cycle(parent, item)[source]

Bases: fparser.common.base_classes.Statement

CYCLE [ <do-construct-name> ]

match[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]
class fparser.one.statements.Backspace(parent, item)[source]

Bases: FilePositioningStatement

REWIND <file-unit-number> REWIND ( <position-spec-list> ) <position-spec-list> = [ UNIT = ] <file-unit-number>

IOMSG = <iomsg-variable>
IOSTAT = <scalar-int-variable>
ERR = <label>

The same for BACKSPACE, ENDFILE.

class fparser.one.statements.Endfile(parent, item)[source]

Bases: FilePositioningStatement

REWIND <file-unit-number> REWIND ( <position-spec-list> ) <position-spec-list> = [ UNIT = ] <file-unit-number>

IOMSG = <iomsg-variable>
IOSTAT = <scalar-int-variable>
ERR = <label>

The same for BACKSPACE, ENDFILE.

class fparser.one.statements.Rewind(parent, item)[source]

Bases: FilePositioningStatement

REWIND <file-unit-number> REWIND ( <position-spec-list> ) <position-spec-list> = [ UNIT = ] <file-unit-number>

IOMSG = <iomsg-variable>
IOSTAT = <scalar-int-variable>
ERR = <label>

The same for BACKSPACE, ENDFILE.

class fparser.one.statements.Open(parent, item)[source]

Bases: fparser.common.base_classes.Statement

OPEN ( <connect-spec-list> )
<connect-spec> = [ UNIT = ] <file-unit-number>
                 | ACCESS = <scalar-default-char-expr>
                 | ..
match[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]
class fparser.one.statements.Format(parent, item)[source]

Bases: fparser.common.base_classes.Statement

FORMAT format-specification

format-specification is ( [ format-item-list ] )
format-item is [ r ] data-edit-descr
            or control-edit-descr
            or char-string-edit-descr
            or [ r ] ( format-item-list )
data-edit-descr is I w [ . m ]
                or B w [ . m ]
                    ...
r|w|m|d|e is int-literal-constant
v is signed-int-literal-constant
control-edit-descr is position-edit-descr
                   or [ r ] /
                   or :
                   ...
position-edit-descr is T n
                    or TL n
                    ...
sign-edit-descr is SS | SP | S
...
match[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]
class fparser.one.statements.Save(parent, item)[source]

Bases: fparser.common.base_classes.Statement

SAVE [ [ :: ] saved-entity-list ]

saved-entity is object-name
             or proc-pointer-name
             or / common-block-name /
proc-pointer-name is name
object-name is name
match[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]
class fparser.one.statements.Data(parent, item)[source]

Bases: fparser.common.base_classes.Statement

DATA data-stmt-set [ [ , ] data-stmt-set ]...

data-stmt-set is data-stmt-object-list / data-stmt-value-list /
data-stmt-object is variable or data-implied-do
data-implied-do is ( data-i-do-object-list ,
                      data-i-do-variable = scalar-int-expr ,
                      scalar-int-expr [ , scalar-int-expr ] )
data-i-do-object is array-element
                 or scalar-structure-component
                 or data-implied-do
data-i-do-variable is scalar-int-variable
variable is designator
designator is object-name
           or array-element
           or array-section
           or structure-component
           or substring
array-element is data-ref
array-section is data-ref [ ( substring-range ) ]
match[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]
class fparser.one.statements.Nullify(parent, item)[source]

Bases: fparser.common.base_classes.Statement

NULLIFY ( <pointer-object-list> ) <pointer-object> = <variable-name>

match[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]
class fparser.one.statements.Use(parent, item)[source]

Bases: fparser.common.base_classes.Statement

Parses USE statement.

Parameters:

Statement (class) – Base fparser class.

Raises:

AnalyzeError – If entity name is not in module.

Fortran syntax construct:

USE [ [ , module-nature ] :: ] module-name [ , rename-list ]
USE [ [ , module-nature ] :: ] module-name , ONLY : [ only-list ]

module-nature is INTRINSIC or NON_INTRINSIC
rename is local-name => use-name
           or OPERATOR ( local-defined-operator ) =>
                        OPERATOR ( use-defined-operator )
only is generic-spec or only-use-name or rename
only-use-name is use-name
match[source]
process_item()[source]

Parse the string containing the Use and store the module name and list of attributes (if any)

tofortran(isfix=None)[source]

Returns the Fortran representation of this object as a string

Parameters:

isfix (bool) – Whether or not to generated fixed-format Fortran

Returns:

Fortran representation of this object

Return type:

str

analyze()[source]

Returns warnings if this object is incorrect

populate_use_provides(all_mod_provides, use_provides, name, rename=None)[source]

Checks for entity name in the module

class fparser.one.statements.Exit(parent, item)[source]

Bases: fparser.common.base_classes.Statement

EXIT [ <do-construct-name> ]

match[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]
class fparser.one.statements.Parameter(parent, item)[source]

Bases: fparser.common.base_classes.Statement

PARAMETER ( <named-constant-def-list> ) <named-constant-def> = <named-constant> = <initialization-expr>

match[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]
class fparser.one.statements.Equivalence(parent, item)[source]

Bases: fparser.common.base_classes.Statement

EQUIVALENCE <equivalence-set-list> <equivalence-set> = ( <equivalence-object> , <equivalence-object-list> ) <equivalence-object> = <variable-name> | <array-element> | <substring>

match[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]
class fparser.one.statements.Dimension(parent, item)[source]

Bases: fparser.common.base_classes.Statement

DIMENSION [ :: ] <array-name> ( <array-spec> )

[ , <array-name> ( <array-spec> ) ]…

match[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]
class fparser.one.statements.Target(parent, item)[source]

Bases: fparser.common.base_classes.Statement

TARGET [ :: ] <object-name> ( <array-spec> )

[ , <object-name> ( <array-spec> ) ]…

match[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]
class fparser.one.statements.Pointer(parent, item)[source]

Bases: fparser.common.base_classes.Statement

POINTER [ :: ] pointer-decl-list

pointer-decl is object-name [ ( deferred-shape-spec-list ) ]
             or proc-entity-name
match[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]
class fparser.one.statements.Protected(parent, item)[source]

Bases: StatementWithNamelist

PROTECTED [ :: ] <entity-name-list>

match[source]
analyze()[source]
class fparser.one.statements.Volatile(parent, item)[source]

Bases: StatementWithNamelist

VOLATILE [ :: ] <object-name-list>

match[source]
analyze()[source]
class fparser.one.statements.Value(parent, item)[source]

Bases: StatementWithNamelist

VALUE [ :: ] <dummy-arg-name-list>

match[source]
analyze()[source]
class fparser.one.statements.ArithmeticIf(parent, item)[source]

Bases: fparser.common.base_classes.Statement

IF ( <scalar-numeric-expr> ) <label> , <label> , <label>

match[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]
class fparser.one.statements.Intrinsic(parent, item)[source]

Bases: StatementWithNamelist

INTRINSIC [ :: ] <intrinsic-procedure-name-list>

match[source]
analyze()[source]
class fparser.one.statements.Inquire(parent, item)[source]

Bases: fparser.common.base_classes.Statement

INQUIRE ( <inquire-spec-list> ) INQUIRE ( IOLENGTH = <scalar-int-variable> ) <output-item-list>

<inquire-spec> = [ UNIT = ] <file-unit-number>
FILE = <file-name-expr>

<output-item> = <expr>
<io-implied-do>
match[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]
class fparser.one.statements.Sequence(parent, item)[source]

Bases: fparser.common.base_classes.Statement

SEQUENCE

match[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]
class fparser.one.statements.External(parent, item)[source]

Bases: StatementWithNamelist

EXTERNAL [ :: ] <external-name-list>

match[source]
analyze()[source]
class fparser.one.statements.Namelist(parent, item)[source]

Bases: fparser.common.base_classes.Statement

NAMELIST / <namelist-group-name> / <namelist-group-object-list> [ [ , ]

/ <namelist-group-name> / <namelist-group-object-list> ]…

<namelist-group-object> = <variable-name>

match[source]
process_item()[source]
tofortran(isfix=None)[source]
class fparser.one.statements.Common(parent, item)[source]

Bases: fparser.common.base_classes.Statement

COMMON [ / [ common-block-name ] / ] common-block-object-list           [ [ , ] / [ common-block-name ] / common-block-object-list ]...

common-block-object is variable-name [ ( explicit-shape-spec-list ) ]
                    or proc-pointer-name
match[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]
class fparser.one.statements.Optional(parent, item)[source]

Bases: StatementWithNamelist

OPTIONAL [ :: ] <dummy-arg-name-list> <dummy-arg-name> = <name>

match[source]
analyze()[source]
class fparser.one.statements.Intent(parent, item)[source]

Bases: fparser.common.base_classes.Statement

INTENT ( <intent-spec> ) [ :: ] <dummy-arg-name-list> <intent-spec> = IN | OUT | INOUT

generalization for pyf-files: INTENT ( <intent-spec-list> ) [ :: ] <dummy-arg-name-list> <intent-spec> = IN | OUT | INOUT | CACHE | HIDE | OUT = <name>

match[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]
class fparser.one.statements.Entry(parent, item)[source]

Bases: fparser.common.base_classes.Statement

ENTRY entry-name [ ( [ dummy-arg-list ] ) [ suffix ] ]

suffix is proc-language-binding-spec [ RESULT ( result-name ) ]
         | RESULT ( result-name ) [ proc-language-binding-spec ]
proc-language-binding-spec is language-binding-spec
language-binding-spec is
              BIND ( C [ , NAME = scalar-char-initialization-expr ] )
dummy-arg is dummy-arg-name | *
match[source]
process_item()[source]
tofortran(isfix=None)[source]
class fparser.one.statements.Import(parent, item)[source]

Bases: StatementWithNamelist

IMPORT [ [ :: ] <import-name-list> ]

match[source]
fparser.one.statements.ForallStmt[source]
class fparser.one.statements.SpecificBinding(parent, item)[source]

Bases: fparser.common.base_classes.Statement

PROCEDURE [ ( <interface-name> ) ] [ [ , <binding-attr-list> ] :: ]

<binding-name> [ => <procedure-name> ]

<binding-attr> = PASS [ ( <arg-name> ) ]
NOPASS
NON_OVERRIDABLE
DEFERRED
<access-spec>

<access-spec> = PUBLIC | PRIVATE

match[source]
process_item()[source]
tofortran(isfix=None)[source]
class fparser.one.statements.GenericBinding(parent, item)[source]

Bases: fparser.common.base_classes.Statement

GENERIC [ , <access-spec> ] :: <generic-spec> => <binding-name-list>

match[source]
process_item()[source]
tofortran(isfix=None)[source]
class fparser.one.statements.FinalBinding(parent, item)[source]

Bases: StatementWithNamelist

FINAL [ :: ] <final-subroutine-name-list>

stmtname = 'final'[source]
match[source]
class fparser.one.statements.Allocatable(parent, item)[source]

Bases: fparser.common.base_classes.Statement

ALLOCATABLE [ :: ] <object-name> [ ( <deferred-shape-spec-list> ) ]
[ , <object-name>

[ ( <deferred-shape-spec-list> ) ]

]…

match[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]
class fparser.one.statements.Asynchronous(parent, item)[source]

Bases: StatementWithNamelist

ASYNCHRONOUS [ :: ] <object-name-list>

match[source]
analyze()[source]
class fparser.one.statements.Bind(parent, item)[source]

Bases: fparser.common.base_classes.Statement

language-binding-spec [ :: ] bind-entity-list
language-binding-spec is
              BIND ( C [ , NAME = scalar-char-initialization-expr ] )
bind-entity is entity-name> | / common-block-name /
match[source]
process_item()[source]
tofortran(isfix=None)[source]
class fparser.one.statements.Else(parent, item)[source]

Bases: fparser.common.base_classes.Statement

ELSE [<if-construct-name>]

match[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]
class fparser.one.statements.ElseIf(parent, item)[source]

Bases: fparser.common.base_classes.Statement

ELSE IF ( <scalar-logical-expr> ) THEN [ <if-construct-name> ]

match[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]
class fparser.one.statements.Case(parent, item)[source]

Bases: fparser.common.base_classes.Statement

Captures a Case statement:

CASE case-selector [ case-construct-name ]
case-selector is ( case-value-range-list ) | DEFAULT
case-value-range is case-value
                 or case-value :
                 or : case-value
                 or case-value : case-value
case-value is scalar-(int|char|logical)-initialization-expr
match[source]
process_item()[source]

Populate the state of this item by parsing the associated line of code

tofortran(isfix=None)[source]

Return the Fortran for this object as a string

analyze()[source]
class fparser.one.statements.TypeIs(parent, item)[source]

Bases: fparser.common.base_classes.Statement

TYPE IS <type-selector> [ <case-construct-name> ] <type-selector> = ( <type-value-range-list> ) <type-value-range> = <case-value> <case-value> = <char>

match[source]
process_item()[source]

Populate the state of this object by parsing the associated line of code

tofortran(isfix=None)[source]

Create the Fortran representation of this object and return it as a string

analyze()[source]
class fparser.one.statements.ClassIs(parent, item)[source]

Bases: fparser.common.base_classes.Statement

CLASS <class-selector> <class-selector> = ( IS <type-value-range-list> | DEFAULT ) <type-value-range> = <case-value> <case-value> = <char>

match[source]
process_item()[source]

Populate the state of this object by parsing the string

tofortran(isfix=None)[source]

Returns the Fortran for this object as a string

analyze()[source]
fparser.one.statements.WhereStmt[source]
class fparser.one.statements.ElseWhere(parent, item)[source]

Bases: fparser.common.base_classes.Statement

ELSE WHERE ( <mask-expr> ) [ <where-construct-name> ] ELSE WHERE [ <where-construct-name> ]

match[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]
class fparser.one.statements.Enumerator(parent, item)[source]

Bases: fparser.common.base_classes.Statement

ENUMERATOR [ :: ] <enumerator-list> <enumerator> = <named-constant> [ = <scalar-int-initialization-expr> ]

match[source]
process_item()[source]
tofortran(isfix=None)[source]
class fparser.one.statements.FortranName(parent, item)[source]

Bases: fparser.common.base_classes.Statement

FORTRANNAME <name>

match[source]
process_item()[source]
tofortran(isfix=None)[source]
class fparser.one.statements.Threadsafe(parent, item)[source]

Bases: fparser.common.base_classes.Statement

THREADSAFE

match[source]
process_item()[source]
tofortran(isfix=None)[source]
class fparser.one.statements.Depend(parent, item)[source]

Bases: fparser.common.base_classes.Statement

DEPEND ( <name-list> ) [ :: ] <dummy-arg-name-list>

match[source]
process_item()[source]
tofortran(isfix=None)[source]
class fparser.one.statements.Check(parent, item)[source]

Bases: fparser.common.base_classes.Statement

CHECK ( <c-int-scalar-expr> ) [ :: ] <name>

match[source]
process_item()[source]
tofortran(isfix=None)[source]
class fparser.one.statements.CallStatement(parent, item)[source]

Bases: fparser.common.base_classes.Statement

CALLSTATEMENT <c-expr>

match[source]
process_item()[source]
tofortran(isfix=None)[source]
class fparser.one.statements.CallProtoArgument(parent, item)[source]

Bases: fparser.common.base_classes.Statement

CALLPROTOARGUMENT <c-type-spec-list>

match[source]
process_item()[source]
tofortran(isfix=None)[source]
class fparser.one.statements.Pause(parent, item)[source]

Bases: fparser.common.base_classes.Statement

PAUSE [ <char-literal-constant|int-literal-constant> ]

match[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]
class fparser.one.statements.Comment(parent, item)[source]

Bases: fparser.common.base_classes.Statement

Attributes

contentstr

Content of the comment.

is_blankbool

When True then Comment represents blank line.

match[source]
process_item()[source]
tofortran(isfix=None)[source]
analyze()[source]