TRACE METHODS not allowed in Methods

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

TRACE METHODS not allowed in Methods

ThSITC
There *are* some problems with the TRACE Verb, which shall be corrected
in later Releases
of NetRexx, when possible (and permitted by the NetRexx Language Board),
as follows:

The TRACE Verb  is *not allowed* by the current NetRexx compiler in some
cases, as
it is handled as any other NetRexx Verb.

In my opinion, it shall and should be defined as a DIRECTIVE, which
shall enable any Netrexx user
to put in any TRACE VERB before or after a METHOD statement, and after
the END of a method.

Reason for this requirement shall be to force TRACING only for a *block
of adjacent methods*,
for instance.

Extract of an example does now follow:
==============================

****************************************************************************
* Program EXTRACT of a NetRexx Program (Scan.nrx, in this instance) ...
****************************************************************************

trace methods
/******************************************************************************/
/* Note, that we do have DetectAbutOp *and* DetectBlankOp in general
Scan now */
/* so that the proper switches might be introduced for any and all
Languages  */
/* when wanted and/or
needed                                                  */
/******************************************************************************/
method DetectBlankOrAbutOp() public returns boolean
    -- ABUT & BLANK are irrelevant in PARSE, ARG, USE (Parse-Verbs)
    if (\this.isParseVerb() & this.token_level=0) -
     & \isMember(this.last_type,'Verb Directive OP') -
     & \isMember(this.token_type,'Verb Directive OP')
    then do
       if this.allow_blank_op & this.c_immediate==' ' then do
          InsertOperator(this.op_blank)
       end
       else if this.allow_abut_op & this.token_loc1== this.last_loc2
then return this.DetectAbutOp()
    end
    return 0

method DetectAbutOp public returns boolean
    -- note that method WasId caters now the special case of closing
parenthesis
    -- and bracket as well ( ')' and ']' must be end of term/expression
    if this.WasVerb() | this.IsVerb() then return 0

    if debug then do
       RexxMsg.debug('Scan.DetectAbutOp:')
       RexxMsg.debug('   WasID='this.WasId())
       RexxMsg.debug('   WasLiteral='this.WasLiteral())
       RexxMsg.debug('   IsId='this.IsId())
    end

    -- Note that also 2 Literals (with different Quotes) are Abutted as well
    if ((this.WasId()| this.WasLiteral()) & (this.c_immediate=="'" |
this.c_immediate=='"')) | -
       (this.WasLiteral()& This.IsId())
    then do
       InsertOperator(this.op_abut)
       return 1
    end

    return 0 -- no Abut

method DetectBlankOp public returns boolean
    if this.WasVerb() | this.IsVerb() then return 0

    if this.WasOP() | this.IsOP() then return 0

    InsertOperator(this.op_blank)
    return 1 -- ACCEPT blank OP
trace off
**************************
* End of EXTRACT
**************************

The NetRexxC.log of Scan.nrx
============================

Program Scan.nrx

  2110 +++ trace methods
       +++       ^^^^^^^
       +++ Error: TRACE METHODS in method will have no effect
Compilation of 'Scan.nrx' failed [one error]

*********************************************************************************
I personally do regard this as a DESIGN LEAK, and a BUG, but leave it
totally to the experts how to cater and resolve this issue, at the minute...
*********************************************************************************
Thomas Schneider.
==========================================================

--
Thomas Schneider, IT Consulting; http://www.thsitc.com; Vienna, Austria,
Europe

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Thomas Schneider, Vienna, Austria (Europe) :-)

www.thsitc.com
www.db-123.com