How to Read Syntax Diagrams

Throughout this document, diagrams illustrate XL Fortran syntax. This section will help you to interpret and use those diagrams.

If a variable or user-specified name ends in _list , you can provide a list of these terms separated by commas.

You must enter punctuation marks, parentheses, arithmetic operators, and other special characters as part of the syntax.

 

  • Read syntax diagrams from left to right and from top to bottom, following the path of the line:
    • The >>--- symbol indicates the beginning of a statement.
    • The ---> symbol indicates that the statement syntax continues on the next line.
    • The >--- symbol indicates that a statement continues from the previous line.
    • The --->< symbol indicates the end of a statement.
    • Program units, procedures, constructs, interface blocks and derived-type definitions consist of several individual statements. For such items, a box encloses the syntax representation, and individual syntax diagrams show the required order for the equivalent Fortran statements.
    • IBM and Fortran 95 extensions are marked by a number in the syntax diagram with an explanatory note immediately following the diagram.
  • Required items appear on the horizontal line (the main path):

     


    >>-keyword
    --required_argument
    ----------------------------------><


  • Optional items appear below the main path:

     


    >>-keyword
    --+-------------------+------------------------------><
    '-optional_argument -'


     

    Note:
    Optional items (not in syntax diagrams) are enclosed by square brackets ([ and ]). For example, [UNIT=]u
  • If you can choose from two or more items, they appear vertically, in a stack.

    If you must choose one of the items, one item of the stack appears on the main path:

     


    >>-keyword--+-required_argument
    -+------------------------------><
    '-required_argument -'


     

    If choosing one of the items is optional, the entire stack appears below the main path:

     


    >>-keyword--+-------------------+------------------------------><
    +-optional_argument -+
    '-optional_argument -'


  • An arrow returning to the left above the main line (a repeat arrow) indicates that you can repeat an item, and the separator character if it is other than a blank:

     


                .-,-------------------.
    V |
    >>-keyword----repeatable_argument -+----------------------------><


     

    A repeat arrow above a stack indicates that you can make more than one choice from the items in the stack.

     


                .-,---------------------.
    V |
    >>-keyword----+-required_argument -+-+--------------------------><
    '-required_argument -'


Sample Syntax Diagram

The following is an example of a syntax diagram with an interpretation:

 


                                              .-,-.
(1) V |
>>-EXAMPLE-------char_constant --+-a -+--+---+----e -+------------->
'-b -' +-c -+
'-d -'

>--name_list ---------------------------------------------------><


 

Notes:


  1. IBM Extension

 

Interpret the diagram as follows:

  • Enter the keyword EXAMPLE .
  • EXAMPLE is an IBM extension.
  • Enter a value for char_constant .
  • Enter a value for a or b , but not for both.
  • Optionally, enter a value for c or d .
  • Enter at least one value for e . If you enter more than one value, you must put a comma between each.
  • Enter the value of at least one name for name_list . If you enter more than one value, you must put a comma between each. (The _list syntax is equivalent to the previous syntax for e .)

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值