wsh → wsh2
wsh | ws2 | comment |
---|---|---|
$-{...} | $-[...$] | geschweifte Klammern nur noch für Variabeln |
$.$abc | $.abc | primary brauchen und erlauben keine $ mehr |
$@abc() | $@abc | call syntax ohne Klammern |
$@abc{arg} | $@%[abc arg$] | call syntax mit Argumenten |
$@.<$dsn ::F | $@<-=[$dsn ::F$] | nach file Operator kommt primary, nicht expression (aber pipe redirect immer noch expr!) |
Implementation Problems
- pipe: syntax für input String, und Mischung String files (wsh und pipe!)
- $@ exprBlock hat nachteile: $@abc funktioniert nicht mehr direkt, $@.$.abc o.ä. (siehe tst) ist kontraintuitiv - besser primary?
- directives: alte Syntax mit benannten units wirklich überflüssig - mit $@proc erreich man selbes ... --- syntax geändert sodass zwischen $#@ und nl verarbeitet wird
idee: var = name | '{' exprS '}' und { } brauchen wir nur noch für das, block wird nur [] oder //
- assignment geht ohne vorgängiges = (aber $= braucht es wegen primary ⇔ statment
- überall wo var steht, hört es auch wieder auf!
- alle $-{3*2} müssen auf $-[3*2$] geändert werden
- alte call Syntax $@abc(), $@abc-{...} etc.. muss auf $@£[abc$] geändert werden
abstract syntax
primary = sConst | var | (( '.' | '-' ) op* ) (sConst | var | block ) $/../ is a blockEnd, neither a primary nor an assignment
wsh = nl'$#version'version)? (nl unit)? ( nl'$#' ( kind (spComm* nl)? unit | hook nl unit | ('*' | 'out' | 'end') text ) )*
concrete syntax
assCon: Concrete Assignment
The details of the syntax is different depending on the context (which '=' is mandatory, optional, forbidden)
assMMM | '=' var '=' exprBlo | '=' nmBlo | in statement with $ |
assOMM | '='? var '=' exprBlo | '=' nmBlo | in statement without $ |
assFMM | var '=' exprBlo | '=' nmBlo | in with |
assFFF | var exprBlo | nmBlo | in proc |
'$', 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 singel 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 (wie in rexx)
- > access to m., plus field access if binary
- & access to varPool, plus field access if binary
- final op (if ends in text) if no ops at all then →& else →*
- if no & or *, then first . → &, remaining . → *
rausgeschmissenes
kind '%' | für expressions ohne noDo und die meisten $ überflüssig ⇒ brauchen wir das wirklich