#493 Trace output from the parse command is sometimes misordered

v4.0
closed
nobody
5
2012-08-14
2008-02-06
No

Sometimes when tracing the parse command, the parsed tokens are displayed in the wrong order from that expected. (Though the order is not explicitly documented, in CMS REXX it is left-to-right.) The display order sometimes appears to be related to a push/pop process. This makes it difficult to determine what is happening, especially when the same template literals are used multiple times in the parse command.

The attached file contains a test case and its output.

Discussion

  • J. L. Turriff

    J. L. Turriff - 2008-02-06

    parsetest and its output

     
  • Rick McGuire

    Rick McGuire - 2008-02-06

    Logged In: YES
    user_id=1125291
    Originator: NO

    My first thought was to answer this as invalid, as processing of the parse instruction is not strictly left-to-right. These items are being displayed in the correct order that they are used and evaluated by the instruction. However, we added some enhancements to trace in 3.2.0, and this appears to be a good place to extend what we've done by displaying the name of the variable as well as the value assigned to the variable. This will make it MUCH easier to figure out what's going on. Here's a piece of the trace from your sample program:

    Committed revision 2339.

     8 *-* parse var message . date time . '[' flow ']' . '(' tree ')' status ',
    

    ' . '{' files '}' . '[' size ']' . '(' duration ')' . '{' rate '}' . '[' count '
    ]
    ' counttype ',' . '(' errorcode ')'
    >V> MESSAGE => "A 2008/02/04 06:00:27 I04000026 B1202098500 [5] Backup
    of (netmail3.ucmo.edu!file:DATA3_SV:/) partially OK, {1764839} files, [19916] MB
    , (27750) seconds, {43} MB/mn, [1] warnings, error code = (2)"
    >L> "["
    >>> "["
    >.> "A"
    >=> DATE <= "2008/02/04"
    >=> TIME <= "06:00:27"
    >.> "I04000026 B1202098500 "
    >L> "]
    "
    >>> "]"
    >=> FLOW <= "5"
    >L> "("
    >>> "("
    >.> " Backup of "
    >L> ")"
    >>> ")"
    >=> TREE <= "netmail3.ucmo.edu!file:DATA3_SV:/"
    >L> ","
    >>> ","
    >=> STATUS <= " partially OK"
    >L> "{"
    >>> "{"
    >.> " "
    >L> "}"
    >>> "}"
    >=> FILES <= "1764839"
    >L> "["
    >>> "["
    >.> " files, "
    >L> "]
    "
    >>> "]"
    >=> SIZE <= "19916"
    >L> "("
    >>> "("
    >.> " MB, "
    >L> ")"
    >>> ")"
    >=> DURATION <= "27750"
    >L> "{"
    >>> "{"
    >.> " seconds, "
    >L> "}"
    >>> "}"
    >=> RATE <= "43"
    >L> "["
    >>> "["
    >.> " MB/mn, "
    >L> "]
    "
    >>> "]"
    >=> COUNT <= "1"
    >L> ","
    >>> ","
    >=> COUNTTYPE <= " warnings"
    >L> "("
    >>> "("
    >.> " error code = "
    >L> ")"
    >>> ")"
    >=> ERRORCODE <= "2"

     


Anonymous

Cancel  Add attachments





Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks