wsh2 → wsh3
wsh2 | wsh3 | comment |
---|---|---|
$>.fEdit() | $>. fEdit() | nach . kommt in wsh3 primary, damit es expression gibt, braucht es Space |
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!) |
todo
- complexe DatenStruktur wie in tut05
- tutorial nach syntax - als tutorial und als test
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 3
expr = textLi | var oPrBlEx? | (noDo+ | '$' sConst | '$' var | '$' ( '.' | '-' ) op* primary )+
- kind # only text
- kind ^ or % is a call: var is the run to call, oPrBlEx the facultativ arguments
- the third variant for the other kinds
- $/../ is a blockEnd, neither a primary nor an assignment,
$[
is illegal
stmt = '$$' oPrBlEx
- default kind for oPrBlEx is =
| ass
| '@' oPrBlEx
- default kind for oPrBlEx is @
| 'ct' stmt
wsh = nl'$#version'version)? (nl unit)? ( nl'$#' ( kind (spCom* nl)? unit | hook nl unit | ('*' | 'out' | 'end') textLi+ ) )*
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 | '$*(' clText '$*)'
- 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
- textLi = any text possibly including '$' until nl (end of line) , or the context dependent stopper, which must be prefixed by '$' and start at the beginning of the line)
- 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 . → *