Inf / Wsh

wsh - Walter's rexx shell

Konzepte

  • hybrid language: Rexx Erweiterung, nichts programmieren was Rexx eh schon kann ....
    • sparsam und flexibel
    • 2 stufige Implementierung, Verständnis und Fehlermeldungen werden dadurch nicht einfacher ...
    • Performance ist zweitrangig, wir erstellen ja Parameterfiles, Jobs usw. also typischerweise kleine Files
  • standardInput, standardOutput, pipes
  • objects
    • methods mit late binding
    • DatenFelder
    • inheritance
    • reflection, MetaData
  • Orthogonalität und Nesting
  • Variable Pool
  • ClassHierachie: class
  • Casts und Semantik WshSem

Begriffe und Konzepte

accessPath ZugriffsWeg auf Felder eines object z.B. in vars gespeichert. Der Zugriff kann über mehrere Stufen erfolgen, entweder auf ein SubFeld oder über die im Subfeld gespeicherte Referenz.
class. In wsh kann man Klassen definieren, dazu benutzt die Laufzeit Umgebung vordefinierte Klassen und einige Klassen werden dynamisch erstellt (z.B. für SQL Abragen). Die wichtigsten Teile der Klassenhierarchie:
String a rexx String, its contents is its value.
Object a reference to an object, this is of course also a rexx String, but its contents is interpreted as objectAdress for an object with a class, not as contents. If a RexxString is and Object or a String is context dependent, many procedure exist in different versions for Strings and Objects as input or output. In some special cases, we dynamically decide wheter an argument is an Object or a String: if we find a class for the value of the string we assume it's an Object, otherwise a String.
StrW an object, that is a string constant, the current implementation is a prefix by m.class.escW = ']'. In the rexx the class is called m.class.classW ⇒ w.
StrV an object, that points to its string contents. If a is the address of the object, then m.a is the string content. In the rexx the class is called m.class.classV ⇒ v.
ORun an object that contains a method, that executes (interprets) some rexx code in its method oRun
JRW a class supporting Reads and Writes. the basis for all types of files and pipes. The oRun method reads until endOfFile and writes each object read unchanged to stdOut. If the JRW is not opened yet, it is opened for read and closed afterwards.
JBuf buffers input in a stem (memory) - from where it can later be read
File a File accessing the FileSystem, implementation depends on the operating system and environment, in our case it uses TSO.

fileSpec the specification for the title and other attributes of a dataset. You can give simply the title, wherein ~ are expanded to your SysPref. You may append further attributes (in tso alloc syntax). After as : follow instructions how to create the dataset, if it does not exist yet
inlineScript in einem Rexx kann ein Teil des Sources so markiert werden, dass dieser SourceTeil vom RexxProgramm selbst gelesen wird und als wsh Syntax interpretiert wird
m All global variables are in the rexx stem m.. All other variables are local. This is implemented by a declaration procedure expose m. for every rexx routine. If an object has address a and a field f1 the contents of f1 is in m.a.f1. It may also use the value in m.a (but this is not recommended) and m.a is called the value of object a.
null der leere String dient als Null Object
pipe Zusammensetzung von zwei Codestücken, indem stdOut des ersten auf stdIn des zweiten geleitet wird. In wsh macht das der Operator $!.
stdIn standard Input ist ein vordefiniertes InputFile, dass mit im Script oder Rexx umgeleitet werden kann
stdOut standard Output ist ein vordefiniertes OutputFile, dass mit im Script oder Rexx umgeleitet werden kann
vars wsh benutzt eine globale SymbolTable. Diese variablen werden mf $=..=.., envPut usw gesetzt und mit $a, oder ${a}, envGet('a') oder envGetO('a') gelesen werden. Auf die Felder der abgespeicherten Objekte kann mit zusammengesetzten Namen zugegriffen werden, z.B. ${a.f1}.