Syntax Explanation: Difference between revisions

From BR Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
 
(21 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Each page contains both syntax notation and a [[Diagram Conventions|diagram]].
Each page contains both syntax notation and a [[Diagram Conventions|diagram]].


The non-diagrammed syntax conventions are as follows:
;The non-diagrammed syntax conventions are as follows:


Uppercase words are BR keywords that must be used exactly or with acceptable [[abbreviation]]s.
*Uppercase syntax words are required BR keywords that may be specified as acceptable [[abbreviation]]s.  
*Although the keywords are uppercase in the diagrams, they may be specified in upper, lower or mixed case.
*Items in [square brackets] are optional.
* [,...] indicates the preceding term can be repeated (comma separated).
*A bar | ''within a braced group'' (e.g. {aaa|bbb} )signifies OR, meaning the braces enclose a bar separated list. ''One of the bar separated terms must be specified.''
*Terms in <angle brackets> must be replaced with appropriate items. When not inherently logical i.e. #<integer>, item descriptions are found in its link or subsequent lines.
*Punctuation, other than "{}, [], <> and ...", must be specified - i.e. quotation marks, commas, colons etc.
*Spaces between items mean one or more space is required.
*Additional spaces may be specified ahead of or following commas.


Items in [square brackets] are optional.
Example:
 
blue {black|grey|white} red {pink|orange}
Items in {braces} can be repeated 0 or more times.
 
Terms in <angle brackets> must be replaced with appropriate items. When not inherently logical i.e. <#file number>, item descriptions are found in subsequent lines.
 
Special characters must be used, i.e. quotation marks, commas, colons etc.
 
Spaces between items mean one space or more is required.
 
A bar | signifies OR, meaning the item preceding the bar can be replaced with the item following it, or the item following a bar following that one. For example:  
 
blue black|grey|white red pink|orange


Satisfactory outcomes would be:
Satisfactory outcomes would be:
Line 26: Line 23:
  etc...
  etc...


All program lines require a line number.
*All program lines require a line number (although it's not included in syntax notation).


;Example 1: Delete Statement  
===Example: Delete Statement===
 
DELETE #<file number>[,REC=<numeric expression>|,KEY=<string expression>][,RESERVE|,RELEASE] : [<error condition> <line ref> [, ...]]


DELETE #<file number>[,REC=<numeric expression>|,KEY=<string expression>][,RESERVE|,RELEASE] : {<error condition> <line ref>[,]}
     
       numeric expression
       numeric expression
       <conditional expression>|<number>|<numeric variable>|<numeric internal function>|<numeric user-defined function>
       <number>|<numeric variable>|<numeric internal function>|<numeric user-defined function>|<conditional expression>
 
              number
              <A rational number up to 15 digits long>. See [[BRconfig.sys#RD|RD in BRConfig.sys]].
 
              numeric variable
              <1-30 alphanumeric characters and underscores, the first of which must be a letter (but not [[FN]]). They also cannot be [[reserved words]]>
 
              numeric internal function
              <An [[:Category:Internal Functions|internal function]] which produces a numeric value>
 
              numeric user-defined function
              <A user defined function that returns a numeric value>


             conditional expression
             conditional expression
             <number> <numeric operator> <number>
             <number> <comparison operator> <number>
             <numeric expression> <numeric operator> <numeric expression>
             |<numeric expression> <comparison operator> <numeric expression>
             <numeric expression> <numeric operator> <numeric expression>{AND <numeric expression> <numeric operator> <numeric expression} {OR <numeric expression> <numeric operator> <numeric expression>}
             |<numeric expression> <comparison operator> <numeric expression> {AND|OR} <conditional expression>
             <value> <comparison operator> <value>
            |<string expression> <comparison operator> <string expression>
            <value><comparison operator><value> {AND <value><comparison operator><value>} {OR <value><comparison operator><value>} {NOT <value><comparison operator><value>}
             |<string expression><comparison operator><string expression> {AND|OR} [NOT]<string expression><comparison operator><string expression>}
         
 
          number
      Conditional expressions evaluate to a boolean numerical value where zero is regarded as false and non-zero is regarded as true. Parentheses, of course, are significant and affect the order of processing. Additional parentheses (properly specified) can be used for visual clarity with no affect on performance. 
          <A rational number up to 15 digits long>. See [[RD in BRConfig.sys]].
 
      string expression
      <string internal function>|<string user-defined function>|<string constant>|<string variable> [<substring operations>] [<concatenation operations>]
 
              string internal function
              <An [[:Category:Internal Functions|internal function]] with a string value>
 
              string user-defined function
              <One with a string value>  
 
              string constant
              <"a series of characters enclosed in quotation marks">  
 
              string variable
              <1-30 alphanumeric characters and underscores, the first of which must be a letter (but not [[FN]]) which ends in a $. They also cannot be [[reserved words]]>
 


          numeric variable
          <1-30 alphanumeric characters and underscores, the first of which must be a letter (but not [[FN]]). They also cannot be [[reserved words]]>
         
          numeric internal function
          <An [[:Category:Internal Functions|internal function]] with a numeric value>
          numeric user-defined function
          <One with a numeric value>
    string expression
    <string internal function>|<string user-defined function>|<string constant>|<string variable> {<substring operations>} {<concatenation operations>}
            string internal function
          <An [[:Category:Internal Functions|internal function]] with a string value> 
            string user-defined function
          <One with a string value>
         
            string constant
            <"a series of characters enclosed in quotation marks">


            string variable
<noinclude>
            <1-30 alphanumeric characters and underscores, the first of which must be a letter (but not [[FN]]) which ends in a $. They also cannot be [[reserved words]]>
[[Category:Basics]]
[[Category:Statements]]
</noinclude>

Latest revision as of 19:40, 1 July 2019

Each page contains both syntax notation and a diagram.

The non-diagrammed syntax conventions are as follows
  • Uppercase syntax words are required BR keywords that may be specified as acceptable abbreviations.
  • Although the keywords are uppercase in the diagrams, they may be specified in upper, lower or mixed case.
  • Items in [square brackets] are optional.
  • [,...] indicates the preceding term can be repeated (comma separated).
  • A bar | within a braced group (e.g. {aaa|bbb} )signifies OR, meaning the braces enclose a bar separated list. One of the bar separated terms must be specified.
  • Terms in <angle brackets> must be replaced with appropriate items. When not inherently logical i.e. #<integer>, item descriptions are found in its link or subsequent lines.
  • Punctuation, other than "{}, [], <> and ...", must be specified - i.e. quotation marks, commas, colons etc.
  • Spaces between items mean one or more space is required.
  • Additional spaces may be specified ahead of or following commas.

Example:

blue {black|grey|white} red {pink|orange}

Satisfactory outcomes would be:

blue black red pink     
blue grey red orange  
blue white red pink 
etc...
  • All program lines require a line number (although it's not included in syntax notation).

Example: Delete Statement

DELETE #<file number>[,REC=<numeric expression>|,KEY=<string expression>][,RESERVE|,RELEASE] : [<error condition> <line ref> [, ...]]
      numeric expression
      <number>|<numeric variable>|<numeric internal function>|<numeric user-defined function>|<conditional expression>
  
             number
             <A rational number up to 15 digits long>. See RD in BRConfig.sys.
  
             numeric variable
             <1-30 alphanumeric characters and underscores, the first of which must be a letter (but not FN). They also cannot be reserved words> 
  
             numeric internal function
             <An internal function which produces a numeric value>
  
             numeric user-defined function
             <A user defined function that returns a numeric value>
           conditional expression
           <number> <comparison operator> <number>
           |<numeric expression> <comparison operator> <numeric expression>
           |<numeric expression> <comparison operator> <numeric expression> {AND|OR} <conditional expression>
           |<string expression> <comparison operator> <string expression>
           |<string expression><comparison operator><string expression> {AND|OR} [NOT]<string expression><comparison operator><string expression>}
      Conditional expressions evaluate to a boolean numerical value where zero is regarded as false and non-zero is regarded as true. Parentheses, of course, are significant and affect the order of processing. Additional parentheses (properly specified) can be used for visual clarity with no affect on performance.  
      string expression
      <string internal function>|<string user-defined function>|<string constant>|<string variable> [<substring operations>] [<concatenation operations>]
  
             string internal function
             <An internal function with a string value>
  
             string user-defined function
             <One with a string value> 
  
             string constant
             <"a series of characters enclosed in quotation marks"> 
  
             string variable
             <1-30 alphanumeric characters and underscores, the first of which must be a letter (but not FN) which ends in a $. They also cannot be reserved words>