Other Forms of Fortran Expressions

 

expression

        : expr

        | named-procedure

 

assignment-expression

        : expr

 

constant-expression

        : constant

 

unary-expression

        : variable

 

expr

        : level-5-expr

        | expr defined-binary-op level-5-expr

 

level-5-expr

        : equiv-operand

        | level-5-expr LOGEQV equiv-operand

        | level-5-expr LOGNEQV equiv-operand

        | level-5-expr LOGXOR equiv-operand

 

equiv-operand

        : or-operand

        | equiv-operand LOGOR or-operand

 

or-operand

        : and-operand

        | or-operand LOGAND and-operand

 

and-operand

        : level-4-expr

        | LOGNOT and-operand

 

level-4-expr

        : level-3-expr

        | level-3-expr LESS level-3-expr

        | level-3-expr GREATER level-3-expr

        | level-3-expr LE level-3-expr

        | level-3-expr GE level-3-expr

        | level-3-expr EQ level-3-expr

        | level-3-expr NE level-3-expr

 

level-3-expr

        : level-2-expr

        | level-3-expr SLASHSLASH level-2-expr

 

level-2-expr

        : and-operand

        | level-2-expr PLUS  add-operand

        | level-2-expr MINUS add-operand

 

add-operand

        : add-operand-f90

        | add-operand-dec

        | unary-expr-dec

 

add-operand-f90

        : mult-operand-f90

        | add-operand-f90 STAR  mult-operand-f90

        | add-operand-f90 SLASH mult-operand-f90

 

mult-operand-f90

        : level-1-expr

        | level-1-expr STARSTAR mult-operand-f90

 

add-operand-dec

        : mult-operand-dec

        | add-operand-f90 STAR  mult-operand-dec

        | add-operand-f90 SLASH mult-operand-dec

        | add-operand-f90 STAR  unary-expr-dec

        | add-operand-f90 SLASH unary-expr-dec

 

mult-operand-dec

        : level-1-expr STARSTAR mult-operand-dec

        | level-1-expr STARSTAR unary-expr-dec

 

unary-expr-dec

        : PLUS  and-operand

        | MINUS and-operand

 

level-1-expr

        : primary

        | defined-unary-op primary

 

defined-unary-op

        : DOT_LETTERS_DOT

 

primary

        : constant

        | variable

        | function-reference

        | LPAREN expr RPAREN

        | AMPERSAND variable

        | process_set

        | LPAREN process_range RPAREN

 

defined-binary-op

        : DOT_LETTERS_DOT

 

int-expr

        : expr

 

scalar-int-expr

        : int-expr

 

variable

        : named-variable

        | subobject

 

named-variable

        : variable-name

        | module_prefix PERCENT_PERCENT variable-name

 

subobject

        : array-elt-or-sect

        | structure-component

        | known-substring

 

known-substring

        : disabled-array-elt-or-sect LPAREN substring-range RPAREN

        | hf-array-abomination

 

substring-range

        : scalar-int-expr COLON scalar-int-expr

        | scalar-int-expr COLON

        |                 COLON scalar-int-expr

        |                 COLON

 

hf-array-abomination

        : named-variable

            LPAREN section-subscript-list RPAREN

            LPAREN section-subscript RPAREN

        | structure PERCENT any-identifier

            LPAREN section-subscript-list RPAREN

            LPAREN section-subscript RPAREN

        | structure DOT any-identifier

            LPAREN section-subscript-list RPAREN

            LPAREN section-subscript RPAREN

 

disabled-array-elt-or-sect

        : DISABLER array-elt-or-sect

 

array-elt-or-sect

        : named-variable LPAREN section-subscript-list RPAREN

        | structure PERCENT any-identifier LPAREN section-subscript-list RPAREN

        | structure DOT any-identifier LPAREN section-subscript-list RPAREN

 

section-subscript-list

        : section-subscript

        | section-subscript COMMA section-subscript-list

 

subscript

        : scalar-int-expr

 

section-subscript

        : subscript

        | subscript-triplet

 

subscript-triplet

        : subscript COLON subscript COLON stride

        | subscript COLON           COLON stride

        |           COLON subscript COLON stride

        |           COLON           COLON stride

        | subscript COLON subscript

        | subscript COLON

        |           COLON subscript

        |           COLON

 

stride

        : scalar-int-expr

 

structure-component

        : structure PERCENT any-identifier

        | structure DOT any-identifier

 

structure

        : named-variable

        | structure-component

        | array-elt-or-sect

 

function-reference

        : SIZEOF LPAREN expr RPAREN

        | named-function LPAREN RPAREN

        | named-function LPAREN actual-arg-spec-list RPAREN

 

named-procedure

        :  PROCEDUREname

 

named-function

        :  PROCEDUREname

        | module_prefix PERCENT_PERCENT PROCEDUREname

named-subroutine

        :  PROCEDUREname

 

actual-arg-spec-list

        : actual-arg-spec

        | actual-arg-spec COMMA actual-arg-spec-list

 

actual-arg-spec

        : actual-arg

 

actual-arg

        : expr

 

any-identifier

        : variable-name

        | PROCEDUREname

 

variable-name

        : identifier-or-key-word

 

PROCEDUREname

        : IDENTIFIER

 

module_prefix

        : any_identifier

        | module_prefix PERCENT_PERCENT any_identifier