Satya Thanks for your reply.
Actually we use Xmotif libraries to generate any GUI. For this we embed xmotif code in our C code. For your reference I am attaching a simple code so that you could get an idea how Xmotif code look like. ===================================================================== #include <Xm/MainW.h> #include <Xm/PushB.h> int main(int argc,char *argv[]) { Widget mainForm, topLevel; topLevel = XtVaAppInitialize(&app, "Appclass", NULL, 0, &argc, argv, fallbacks, NULL); n=0; XtSetArg (args[n], XmNx, 0); n++; XtSetArg (args[n], XmNy, 0); n++; XtSetArg (args[n], XmNheight, 275); n++; XtSetArg (args[n], XmNwidth, 600); n++; mainForm = XmCreateForm(toplevel,"mainForm", args ,n); sprintf(buf,"HELLO ALL"); n=0; XtSetArg (args[n], XmNx, 90); n++; XtSetArg (args[n], XmNy, 20); n++; XtSetArg (args[n], XmNheight, 35); n++; XtSetArg (args[n], XmNwidth, 100); n++; XtSetArg (args[n], XmNalignment, XmALIGNMENT_CENTER); n++; XtSetArg (args[n], XmNlabelString, XmStringCreateSimple(buf)); n++; label1 = XmCreateLabelGadget(main_form, "label1", args ,n); XtManageChild(label1); ------------------- ------------------- return 0; } =================================================================== This is not a complete code but just a part of code. Now I want to extract Xmotif related information ( Form name, labels, buttons etc. and their parameters i.e. height, width, alignment etc.) from this code and generate a parse tree according to parent child relation of these elements. I will be highly grateful if you or anybody could help me in writing code or algorithm to do this so that in future I could make changes in the functionality according to my requirement. --- Thanks in advance Mukesh Kaushal On 26/06/2008, Satya <[EMAIL PROTECTED]> wrote: > > Do you require a full C parser to extract this stuff? sometimes such > extraction might be possible only using a lexer (I don't know how Xmotif > code looks like but I am guessing it's only C functions and data types). You > could use something like CIL (http://manju.cs.berkeley.edu/cil/) to give > you a parsed syntax tree on which you can operate. You can try posting your > problem on comp.compilers. > > /satya > > On Wed, Jun 25, 2008 at 12:56 AM, Mukesh Kaushal <[EMAIL PROTECTED]> > wrote: > >> Hi all >> >> I am using an Xmotif application. Code is written in C. Now I want to >> parse >> my C code so that I can extract all the xmotif related info from the code. >> So kindly suggest me how to parse my C source code for this. >> >> -- >> >> --- >> Regards >> Mukesh Kaushal >> _______________________________________________ >> help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison >> > > -- --- Regards Mukesh Kaushal _______________________________________________ help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison