git @ Cat's Eye Technologies OpenZz / master testsuite / deref_param.zz.SKIPPED
master

Tree @master (Download .tar.gz)

deref_param.zz.SKIPPED @masterraw · history · blame

!!
!!  Zz Dynamic Parser Library
!!  Copyright (C) 1989 - I.N.F.N - S.Cabasino, P.S.Paolucci, G.M.Todesco
!!
!!  The Zz Library is free software; you can redistribute it and/or
!!  modify it under the terms of the GNU Lesser General Public
!!  License as published by the Free Software Foundation; either
!!  version 2.1 of the License, or (at your option) any later version.
!!
!!  The testsuite test scripts are distributed with Zz as part of it,
!!  also under the LGPL.
!!
!!  The Zz Library is distributed in the hope that it will be useful,
!!  but WITHOUT ANY WARRANTY; without even the implied warranty of
!!  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
!!  Lesser General Public License for more details.
!!
!!  You should have received a copy of the GNU Lesser General Public
!!  License along with this library; if not, write to the Free Software
!!  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
!!

!!
!! test for * rule to "dereference" a param and use the value 
!! to define a new param
!!
!! We Need to ignore the line that prints the memory address because
!!  it will vary from test to test naturally:
!! IGNORE_LINE_PATTERN=:[A-Z|0-9]*$
!!
!!REFERENCE OUTPUT:
!!name= ggg 
!!  0L ggg                  == reg_var:08059A58
!!  1L l                    == { 1 0 }
!!  1L m                    == 1
!!  1L name                 == ggg
!!exiting from action.... 
!!  0L ggg                  == reg_var:08059A58
!!{ 1 0 } 
!!END OUTPUT

!!/lvalue->"*" ident^$ :pass

/stat->"temporary" "foo" tdecllist^$
/tdecllist->tdecllist^$ "," tdeclitem^$
/tdecllist->tdeclitem^$

/$arg-> reg_var^$ : pass

/tdeclitem->lvalue^name {
    /m = 1
    /l= {m 0}

    /print "name=",name

    /*name 1= l as reg_var
    
    /param
    /print "exiting from action...."
}

/stat-> "miao" reg_var^name {
   /mn = name as list
   /print mn
}

temporary foo ggg
/param
miao ggg