From: Jeff H. <Je...@Je...> - 2020-03-28 20:53:32
|
<html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body> <p>I have just submitted an updated SPECs stage and tests.</p> <p>There are 84 separate tests in 8 files. There are a couple from the IBM Pipeline book that we still fail.</p> <p>Here is the current documentation:</p> <p><tt>/** spec<br> +-STOP--ALLEOF----+ (3) v----------------------------------------+<br> >>--SPECs--+-----------------+------+--+-| Group |-------------------------+-+-----------><<br> +-STOP-+-ANYEOF-+-+ (3) +-READ------------------------------+ (5)<br> +-n------+ (3) +-READSTOP--------------------------+<br> +-WRITE-----------------------------+<br> +-SELECT-+-streamnum-+--------------+<br> | +-streamid--+ | (3)<br> | +-FIRST-----+ |<br> | +-SECOND----+ |<br> +-PAD--+-char----+------------------+<br> | +-hexchar-+ |<br> | +-BLANK---+ |<br> | +-SPACE---+ |<br> +-+-WORDSEParator---+--+--char---+--+ (3)<br> +-WS------------- + +-hexchar-+ (3)<br> +-FIELDSEparator- + +-BLANK---+ (3)<br> +-FS------------- + +-SPACE---+ (3)<br> <br> Group:<br> |--| Input |--| Conversion |--| Output |--| Alignment |--|<br> <br> Input:<br> |--+-Words-(1)-wnumberrange----------------------+-------|<br> +-Fields-(1)-fnumberrange---------------------+ (3)<br> +-cnumberrange--------------------------------+<br> +-/string/------------------------------------+<br> +-Xhexstring----------------------------------+<br> +-Hhexstring----------------------------------+<br> +-Bbinstring----------------------------------+<br> | +-FROM--1-------+ +-BY--1-----+ |<br> +-+-RECNO--+-+---------------+-+-----------+--+<br> | +-NUMBER-+ +-FROM--fromnum-+ +-BY--bynum-+ |<br> +-TODclock------------------------------------+<br> <br> Conversion:<br> |-+-------+--+--------------------+------|<br> +-STRIP-+ +-B2C----------------+<br> +-B2D----------------+ (4)<br> +-B2X----------------+ (4)<br> +-C2B----------------+<br> +-C2D----------------+<br> +-C2F----------------+ (3)<br> +-C2I----------------+ (3)<br> +-C2P-+------------+-+ (3)<br> | +-(2)(scale)-+ | (3)<br> +-C2V----------------+ (3)<br> +-C2X----------------+<br> +-D2C----------------+<br> +-D2X----------------+ (4)<br> +-F2C----------------+ (3)<br> +-I2C----------------+ (3)<br> +-P2C-+------------+-+ (3)<br> | +-(2)(scale)-+ | (3)<br> +-V2C----------------+ (3)<br> +-X2B----------------+ (4)<br> +-X2C----------------+<br> +-X2D----------------+ (4)<br> +-f2t----------------+<br> +-LOWER--------------+ (4)<br> +-UPPER--------------+ (4)<br> +-STRING-------------+ (4)<br> <br> Output:<br> |--+-Next-+-------+-------+--|<br> | +-(2).n-+ |<br> +-NEXTWord-+-+-------+-+<br> +-NWord----+ +-(2).n-+ |<br> +-collumnrange---------+<br> <br> Alignment:<br> |--+--------+--|<br> +-Left---+<br> +-Center-+<br> +-Centre-+<br> +-Right--+<br> <br> Ranges (cnumberrange, fnumberrange (3), wnumberrange):<br> |--+-snumber-+--(2)--+-------------------------+--|<br> +---*-----+ +--.-----(2)----number----+<br> +- - -+--(2)--+-snumber-+-+<br> +--;--+ +---*-----+<br> <br> Notes:<br> (1) Blanks are optional in this position.<br> (2) Blanks are not allowed here.<br> (3) CMS only. Not yet implemented in njpipes<br> (4) Njpipes only. Not yet implemented in CMS<br> (5) READ is giving the same output as READSTOP when the streams are different length.<br> [6] This senses if it is the first stage, but comment stages will fool it into not<br> producing any output.<br> <br> **/</tt></p> <p>The one bug left that I'm aware of, is if there is some data generating group, such as a delimited string, record number, or TODclock, then at the end of file, an extra output record of just that generated data is put out.<br> <tt></tt></p> <p>The only parts of the newest IBM version that I have included here are<tt> FIRST </tt>and <tt>SECOND. </tt> This newest version also includes a mini-language for doing all sorts of things in the conversion phase. This would be very difficult to include here. I suggest that instead we add a way to incorporate either a sub-pipeline (apparently difficult) or user NetRexx code (fairly easy, but potentially dangerous). I have a bare-bones working test of this later: it has, in the conversion section, user_code in parentheses: <tt>specs /xyz/ (data = data.changestr('y','A')) 1</tt> does put out <tt>xAz</tt>.</p> <p>Is such a facility worthwhile at all? Is it worth putting some effort into implementing it? I'd like to limit it's reach to only the variables with the suggested names of <tt>data</tt> (input and output -- or should these be different?) and <tt>user</tt> a "persistent" indexed variable available to store things across groups in a call and across records in a pipe. At the moment, I don't know how to do this isolation.</p> <p>The other new feature that looks worthwhile implementing is EOF handling. I have not looked at how hard this would be. (And at the moment, I have had enough time with SPECs!)</p> <p>The whole thing <u>should</u> be redone at some time using the IRange and Dstring classes for parsing the input.</p> <p>Jeff<br> </p> </body> </html> |