Sponsored Content
Full Discussion: grep matter between braces
Top Forums Shell Programming and Scripting grep matter between braces Post 302297646 by ultimatix on Saturday 14th of March 2009 07:33:27 AM
Old 03-14-2009
Bug grep matter between braces

Code:
#include<header.h>
void classname :: pvvd_init        
                   ( abcd
                    ,efgh
                    ,ijkl
                    ,mnop )
{                       
  rvcl_tabl_name_tabl.pvvd_init
                   ( xxxx
                    ,"tabl_mame" ) ;
  rvvd_call_tabl ()
}
 
void classname :: rvvd_call_tabl       <<<<  ----  2nd function 
                   ( abcd
                    ,efgh
                    ,ijkl
                    ,mnop )
{
  rvcl_tabl_name_tabl.pvvd_init
                   ( xxxx
                    ,"tabl_mame" ) ;
rvvd_inst_for_tabl ()
}
void classname :: rvvd_inst_for_tabl    <<<<---- 3rd function
                   ( abcd
                    ,efgh
                    ,ijkl
                    ,mnop )
{
  rvcl_tabl_name_tabl.pvvd_init
                   ( xxxx
                    ,"tabl_mame" ) ;
 rvcl_tabl_name_tabl.pvvd_inst
}

In the above cpp class
pvvd_inst is called by function rvvd_inst_for_tabl which is in turn called by function
rvvd_call_tabl..
I am developing a script which reads a cpp class .. Finds the pvvd_inst function
and backtraces it ...
eg : pvvd_inst <<<<<------ rvvd_inst_for_tab <<<<<------rvvd_call_tabl ..
I have tried it in following way :

I am reading cpp files from a file and grepping for a paatern
Code:
grep -w 'pvvd_inst' $rvst_clas_name >> tempfile1
        
    if  [ `ll inst_fncn.tmp | awk {'print$5'}` -eq 0 ] ;
        then
  Now I am checking the filesize , If its equal to zero thn i am concluding 
  inst fncn not callled in this class
  echo ""
  echo "pvvd_inst not called in this class "$rvst_clas_name""

   The problem starts with else part .... How do i proceedc  
        
 else
 In the else part , The logic that i developed is to  read the file line by line
 Capture text between opening and closing braces of each function .. and then grep 
 but I am running short of how to implement these ideas ...
   fi

Please Help .....
thanks and Regards
--- Ultimatix

Last edited by Franklin52; 03-14-2009 at 04:06 PM.. Reason: adding code tags
 

7 More Discussions You Might Find Interesting

1. Linux

Need help with this matter

I have a PC that was built in Europe pre-installed with Windows 2000. The HDD is 40GB, but, its split up as two 20GB (Taken up by Windows). I want to take over my Mandrake 9.1 CDs and install Linux on that machine. My question is, how would I proceed to install Linux this way??? Now, If... (1 Reply)
Discussion started by: wardialer
1 Replies

2. Shell Programming and Scripting

grep to find content in between curly braces, "{" and "},"

problem String ~~~~~~~~~~~~~~~~~~ icecream= { smart peopleLink "good" LC "happy" , smartpeopleLink "dull" LC "sad" } aend = {smart vc4 eatr kalu} output needed ~~~~~~~~~~~~~~~~~~ smart peopleLink "good" LC "happy" , smartpeopleLink "dull" LC "sad" smart vc4... (4 Replies)
Discussion started by: keshav_rk
4 Replies

3. Shell Programming and Scripting

How to delete matter in between two lines

help I am having text file like this... ------------------------END OF UPDATION ------------------ xxxxxxxxxxxxxxxxxxxxxxxxx yyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyy 1 row updated ------------------------END OF UPDATION ------------------ TTTTTTTTTTTTTTTT FFFFFFFFFFFFFFFFF ... (3 Replies)
Discussion started by: suryanarayana
3 Replies

4. Shell Programming and Scripting

Terminal to the front no matter what

Is there a way to bring the terminal script to the front? I am running this script through OMCEdit which is then running it through Terminal. I have some dialog boxes (using osascript) and the dialog boxes are not coming to the front...Terminal bounces and I have to click on Terminal to see the... (1 Reply)
Discussion started by: mainegate
1 Replies

5. Solaris

Does file extension matter in UNIX?

Hi friends, I was wondering if UNIX programs really care about file extensions like Microsoft Windows applications do. Because I think an extension doesn't really change the nature of a file, or does it? But when I try to compile the c source code file named "hello", gcc gives me error, saying... (1 Reply)
Discussion started by: gabam
1 Replies

6. Shell Programming and Scripting

For getting value between the braces

Hi I have a file called tmp with the content as belowmore tmp NAMELIST(Hari) NAMELIST(Raju) I want to get the values between the brackets. When I executed the below command on zlinux I get the output which I wantedmore tmp |awk -F'' '{print $2}' But when I execute the same in... (3 Replies)
Discussion started by: harimhkr
3 Replies

7. Shell Programming and Scripting

Code that has to end no matter what

Since this is maxxing out my CPU, is there anything I can add that will make sure stress always ends? echo "CPU Stress Test" >> CPU_Stress_Test.txt echo "stress --cpu 8 --io 4 --vm 2 --vm-bytes 128M --timeout 1m" >> CPU_Stress_Test.txt echo >> CPU_Stress_Test.txt date +"%Y-%m-%d-%H-%M" >>... (9 Replies)
Discussion started by: drew77
9 Replies
Wx::Api(3pm)						User Contributed Perl Documentation					      Wx::Api(3pm)

NAME
API - wxPerl extension API documentation DESCRIPTION
WXPL_API_VERSION An integer value used to differentiate wxPerl versions, it is guaranteed to be non-decreasing. wxPerl 0.15 value is 0150; wxPerl 1.00 value will be 1000, wxPerl 2.12 value will be 2120. Introduced in wxPerl 0.15 wxPli_create_evthandler SV* wxPli_create_evthandler( pTHX_ wxEvtHandler* object, const char* classname ); Creates a new hash reference, blessed into "classname", and binds"object" to it. Introduced in wxPerl 0.16 wxPli_evthandler_2_sv SV* wxPli_evthandler_2_sv( pTHX_ SV* var, wxEvtHandler* evth ); Same as wxPli_object_2_sv, but works with "wxEvtHandler"-derived classes, which includes all "wxWindow"-derived classes. Introduced in wxPerl 0.16 wxPli_get_class const char* wxPli_get_class( pTHX_ SV* ref ); The C++ equivalent of "$class = ref( $obj ) || $obj"; the pointer returned by the function is potentially temporary. wxPli_non_object_2_sv SV* wxPli_non_object_2_sv( pTHX_ SV* var, void* data, const char* package ); Binds a generic pointer to an "SV*", and returns it; the new binding is blessed into the given "package". Introduced before wxPerl 0.14 wxPli_object_2_sv SV* wxPli_object_2_sv( pTHX_ SV* var, wxObject* object ); Binds a "wxObject*" pointer to an "SV*", and returns it. If the object is already bound to an "SV*", returns a reference to the existing "SV*", otherwise, it creates a new binding; in the latter case, the new "SV*" is blessed into a package obtained through the wxWidgets RTTI system. Introduced before wxPerl 0.14 wxPli_push_arguments void wxPli_push_arguments( pTHX_ SV*** stack, const char* argtypes, ... ); // example wxPli_push_arguments( aTHX_ SP, "iP", 12, "foo" ); Pushes a variable number of arguments on the perl stack, it is useful for passing parameters to a Perl function. The "argtypes" string describes the types of subsequent arguments, each character of the string specifying the type of a single argument. Possible values are: b a "bool" value i an "int" value l a "long" value L an "unsigned long" value d a "double" value p a "char*" value w a "wxChar*" value P a "wxString*" value S a "SV*", a copy of the SV is pushed on the stack s a "SV*", the pointer itself is pushed on the stack O a "wxObject*", the function will internally call "wxPli_object_2_sv" and push the result on the stack. o this is the only type that uses 2 parameters: the first is a "void*", the second a "char*"; the function will internally call "wxPli_non_object_2_sv" and push the result on the stack. Introduced before wxPerl 0.14 wxPli_sv_2_object void* wxPli_sv_2_object( pTHX_ SV* scalar, const char* classname ); Extracts a bound pointer from a perl reference, checking that the reference belongs to the correct class (die()s on failure), and returns it. If "classname" is "NULL", the check is not done. Introduced before wxPerl 0.14 wxPli_wxChar_2_sv SV* wxPli_wxChar_2_sv( pTHX_ const wxChar* str, SV* out ); Stores a string into a "SV*", and returns the "SV*". Introduced before wxPerl 0.14 wxPli_wxString_2_sv SV* wxPli_wxString_2_sv( pTHX_ const wxString& str, SV* out ); Stores a string into a "SV*", and returns the "SV*". Introduced before wxPerl 0.14 AUTHOR
Mattia Barbon <mbarbon at cpan dot org> perl v5.14.2 2007-03-16 Wx::Api(3pm)
All times are GMT -4. The time now is 09:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy