abstract syntax 6
stmt = '$$' oPrBlEx
- omitting var is only allowed, if a named block follows
concrete syntax
'$', nl, spaces, comments
dolNlEscape | ignored | explanation | ||
---|---|---|---|---|
primary | no $, nl, spaces, comments except, of course within a started block | |||
expr | com | $ only to start a primary, spaces are part of noDo, comments are squashed to 1 or 0 spaces | ||
var | exStr | |||
expP | com sp | |||
pipe | < > >> | stmt | com sp | com and sp are handled by expr if neighbouring, nl separates stmts and/or expr see stmtExpr and dolStmt | |
unit | ; | com sp | com sp are handled by pipe if neighbouring | |
nmBlo | ending /.../ | |||
block | ] | |||
exprBlo | exStr | |||
ass | com sp nl | |||
stmt | stmt | com sp nl |
- ignored: lexcicals ignored within term, but not before and after (there rule for parent element applies)
- exStr: leading and trailing spaces and comments around expr are stripped
- dolNlEscape which syntax terms must be prefixed by an escape character, so they are recognized
- stmtExpr = (spCom* | expr) ( nl expr)* (nl spCom*)?
- partial lines besides statements are ingored
- dolStmt
- '$$' does neither need nor allow a third $
- both forms of the assignment statement must be prefixed by '$=', but not by '$=='
- all other statements must be prefixed by a single '$'. For historical reason a prefix of '$@' (but not '$@@') is allowed
lexicals
- com = '**' noNL* | '*+' noNL* nl | '$*(' text '$*)'
- name = alfaChar (alfaNumChar | '_', '@')*
- wsh variable pool is casesensitive, but not rexx names!
- statement names for, with etc. are not a name, however ${for} is a primary
- sp = a single space character
- nl = new line (pseudo character in z/os for next line)
- noNl = any single character except nl
- noDo = any single character neither $ nor nl
- text = any text possibly including '$' or nl until to the context dependent stopper, which must be prefixed by '$')
- sConst = string constant: single or double quoted String with any nl's: 'abc', "e", 'I''m' etc.
variable name operators:
- . inline dot (ohne variable expansion wie in rexx)
- > access to m., plus field access if binary
- & access to varPool, plus field access if binary
- if no op at all, then like final op &