Introduction
<command> ::= <basic> ^ <basic> <pipe-to> ^ <basic> <pipe-from> ^ <basic> <pipe-to> <pipe-from> ^ <basic> <pipe-from> <pipe-to>
<first-command> ::= <basic> ^ <basic> <pipe-from>
<last-command> ::= <basic> ^ <basic> <pipe-to>
<pipe-from> ::= <<> <ekey-name>
<pipe-to> ::= <>> <key-name> ^ <>>> <key-name>
<>> ::= The greater than character ">".
<>>> ::= Two greater than characters ">>".
<ekey-name> ::= # an existing key name #
<order-code> ::= # A character string specifing one of the operations defined by the kt of <ekey-name> #
<token-list> ::= ^ <token-list> <token>
<token> ::= <word> ^ <char-string> ^ <number> ^ <list>
<word> ::= # a string of non-blank printable characters not beginning with (, /, ' or " #
<char-string> ::= "<char-list>" ^ '<char-list>'
<hex-list> ::= <hex-digit><hex-digit> ^ <hex-list> <blank> <hex-list> ^ <hex-list><hex-list>
<decimal-number> ::= <digit> ^ <decimal-number><digit>
<key-words> ::= ^ <key-words> <blank> <key-value>
<key-value> ::= <label> <blank> <token>
<format> ::= 0
<posistional-list> ::= ^ <posistional-list> <blank> <posistional>
<posistional> ::= <var-spec> ^ <char-string> <blank> <var-spec>
<key-word-list> ::= <key-word> ^ <key-word-list> , <key-word>
<key-word> ::= <var-spec>
<var-spec> ::= <label> ^ ( <label> , <type> [, <help>] )
<type> ::= ANY ^ KEY ^ NKEY ^ EKEY ^ NUMBER ^ NULL ^ LIST ^ <type> / <type>
<help> ::= <char-string>
When used interactivly, the <char-string>s in the <posistional-list> may be printed as prompts. (N.B. this is not currently implemented.) If the user requests help while a <var-spec> is being filled then its <help> will be displayed. If there is no <help> then the <label> will be displayed. If the user requests help when a key word is expected then a list of the valid key words will be displayed.
The built in labels.
ORDERCODE is assigned the value of the order code.
KEY - The string must be a valid key name.
NKEY - The string must be a valid non-existing key name.
EKEY - The string must be a valid existing key name.
NUMBER - The string must be a valid <number>.
NULL - The null character string is acceptable.
LIST - A list of tokens is acceptable
<only-jump-spec> ::= KEY( <ordercode> [, <parmstring>] [; [ <offered-key-list>]] ==> [ RETURNCODE ] [, RETURNSTRING] [; [ <return-key-list>]] )
<first-jump-spec> ::= KEY( kt+5 [, <parmstring>] [; [ <offered-key-list>]] ==> [ RETURNCODE ] )
<middle-list> ::= ^ <middle-list> <middle-jump-spec>
<last-jump-spec> ::= COKEY( <ordercode> [, <parmstring>] [; [ <offered-key-list>]] ==> [ RETURNCODE ] [, RETURNSTRING] [; [ <return-key-list>]] )
<ordercode> ::= ORDERCODE ^ <ordercode> <arith-op> <arith-expression>
<multiply-op> ::= * ^ / ^ MOD
<arith-op> ::= <multiply-op> ^ <add-op>
<primary> ::= <label> ^ <number> ^ ( <arith-expression> )
<term> ::= <primary> ^ <term> <multiply-op> <primary>
<arith-expression> ::= <term> ^ <arith-expression> <add-op> <term> ^ <add-op> <factor>
<expression> ::= <char-string> ^ <arith-expression> ^ <label> ^ <expression><string-op><expression>
<string-op> ::= .. ^ ^^
<default> ::= <key-id>
The extension for the parm string allows numbers or <expressions> to be converted to binary (BIN) or left in character form (CHAR).
The operator <op> .. concatinates two strings with a period between them.
The operator <op> ^^ concatinates two strings.
If the template for AUXFILE GETSEGMENT is:
KEY(0, ( (4,systemnumber,BIN), (8,cmsfilename), (8,cmsfiletype), (2,cmsfilemode), (12,project) ); (psb,"spacebank",'0D0C'X), (meter,"meter",6), (sb,"spacebank",'0D0C'x), (circuitkey,,'20'x) ==> RETURNCODE; newsegmentname)
The example shows that a "concatanate with blank" operator could save a lot of ^^ " " sequences.
The string generated to pass to the key requires parsing within that domain. A protocol where k(oc,s1,s2,s3;... results in k(oc,((l1,n),(s1,l1),(l2,n),(s2,l2),(l3,n),(s3,l3));... would help. (It will also be necessary for programming language level functions.) What should n be? 2 and 4 seem the best candiates.
An associated problem with the compound strings. The template langauge should be able to specify that compound strings are or are not assembled with the length indicators.
<pattern-list> ::= <var-spec> ^ <pattern-list> <pattern-select> <var-spec>
<pattern-select> ::= <char-string> ^ <== ^ <blank>
<var-spec> ::= <label> ^ ( <label> , <type> [, <help>] )
<type> ::= ANY ^ DEC ^ HEX ^ KEY ^ NKEY ^ EKEY ^ NUMBER ^ OPTION ^ <type> / <type>
<help> ::= <char-string>
If the user requests help while scanning for a <pattern-select> then the <help> from the previous <var-spec> (the one being filled) will be displayed. If there is no <help> then the <label> will be displayed.
The built in labels.
ORDERCODE is assigned the value of the order code.
DEC - The string must be a valid <decimal-number>.
HEX - The string must be a valid <hex-number>.
KEY - The string must be a valid key name.
NKEY - The string must be a valid non-existing key name.
EKEY - The string must be a valid existing key name.
NUMBER - The string must be a valid <number>.
OPTION - The variable <label> will be set to the character value of the following <pattern-select> string if it is found. Otherwise <label> will be set to the NULL string.
This system provides no way to remove leading and trailing blanks from the string. The kludge REX uses to "solve" the problem is that if and only if the <selector> is a <blank> then the leading and trailing blanks will be removed from the previous token.
The re-scan operator <== makes it difficult to provide help for the order free keywords. Perhaps some syntax e.g. [ ... ^ ... ] to choose one based on the first keyword found and { ... ^ ...} to search for the first keyword found, parse the string as specified and repeat to the end of the string. This change would also fix the confusion (bug) in the example if the project is " sb " by replacing the parse part of the template after cmsfileid by:
The string generated to pass to the key requires parsing
within that domain. A protocol where k(oc,s1,s2,s3;...
results in
k(oc,((l1,n),(s1,l1),(l2,n),(s2,l2),(l3,n),(s3,l3));...
would help. (It will also be necessary for programming
language level functions.) What should n be. 2 and 4 seem
the best candiates.
There needs to be a way to write an arithmetic expression for the ORDERCODE.
An associated problem with the compound strings. The template langauge should be able to specify that compouund strings are or are not assembled with the length indicators.
Very predictable so that someone that knew what keys and strings were needed and what strings and keys were returned could enter the command without looking it up. This may make the language look very low level but I think not. There is a single GNOSIS primitave that applies to all levels of complexity. The model is the key call. All work in GNOSIS is accomplished by invoking keys. Well here it is by example not in BNF.
"abc" or variablename or strn ]
]
strn concatenated.
AUXFILE GETSEGMENT ("142","profile exec":,,,TYMNET.ME) ==> RC (:mystuff);
AUXFILE GETSEGMENT
(sysno,filename,project:,SB,M,SB,TYMNET.ME)
==> (:MYSTUFF);
AUXFILE GETSEGMENT (sysno,filename]
]
" "]
]
filetype:,,,TYMNET.ME)
==> (:MYSTUFF);
RC GETEQUAL (name:) ==> (:key);
RC PUTNEW (name:key) ==> RC;
NODE NODESWAP+5 (:newkey) ==> (:oldkey);
Mostly the templates hold true without modification. The sysno string could specify DEC and thus be written 142 instead of "142" but I would prefer that whatever it be it be the same throughout the world. Strings that are sometimes HEX and sometimes ASCII present a problem. If the key always wants ASCII or HEX then the template could do the conversion. But as the RC wants the name to be binary if it is ENTRY sequence there would have to be separate templates for the two types of RC. This has some attractions thus: