Previous Next

Examples of syntax descriptions
In this example, ACCUM is a keyword, and aggregate and expression are variables:
 
Syntax 
ACCUM aggregate expression 
FOR is one of the statements that can end with either a period or a colon, as in this example:
 
FOR EACH Customer NO-LOCK:
  DISPLAY Customer.Name.
END.
In this example, STREAM stream, UNLESS-HIDDEN, and NO-ERROR are optional:
 
Syntax 
DISPLAY [ STREAM stream ] [ UNLESS-HIDDEN ] [ NO-ERROR ]
In this example, the outer (small) brackets are part of the language, and the inner (large) brackets denote an optional item:
 
Syntax 
INITIAL [ constant [ , constant ] ]
A called external procedure must use braces when referencing compile-time arguments passed by a calling procedure, as shown in this example:
 
Syntax 
{ &argument-name }
In this example, EACH, FIRST, and LAST are optional, but you can choose only one of them:
 
Syntax 
PRESELECT [ EACH | FIRST | LAST ] record-phrase
In this example, you must include two expressions, and optionally you can include more. Multiple expressions are separated by commas:
 
Syntax 
MAXIMUM ( expression , expression [ , expression ] ... )
In this example, you must specify MESSAGE and at least one expression or SKIP [ (n) ], and any number of additional expression or SKIP [ ( n ) ] is allowed:
 
Syntax 
MESSAGE { expression | SKIP [ ( n ) ] } ...
In this example, you must specify {include-file, then optionally any number of argument or &argument-name = "argument-value", and then terminate with }:
 
Syntax 
{ include-file 
    [ argument | &argument-name = "argument-value" ] ... }
Long syntax descriptions split across lines
Some syntax descriptions are too long to fit on one line. When syntax descriptions are split across multiple lines, groups of optional and groups of required items are kept together in the required order.
In this example, WITH is followed by six optional items:
 
Syntax 
WITH [ ACCUM max-length ] [ expression DOWN ] 
  [ CENTERED ] [ n COLUMNS ] [ SIDE-LABELS ]
  [ STREAM-IO ]
Complex syntax descriptions with both required and optional elements
Some syntax descriptions are too complex to distinguish required and optional elements by bracketing only the optional elements. For such syntax, the descriptions include both braces (for required elements) and brackets (for optional elements).
In this example, ASSIGN requires either one or more field entries or one record. Options available with field or record are grouped with braces and brackets:
 
Syntax 
ASSIGN   { [ FRAME frame ] { field [ = expression ] }
            [ WHEN expression ] } ...
       | { record [ EXCEPT field ... ] }

Previous Next
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates.