[Prev][Next][Index]
Re: Problems unparsing C code
- From: "Beata Winnicka" <bfatyga@slab.cica.indiana.edu>
- Date: Tue, 4 Oct 94 17:39:24 -0500
- To: Diego Novillo <diego@cs.ualberta.ca>
- Subject: Re: Problems unparsing C code
- Cc: sage-bugs@cica.indiana.edu ( Sage bug reports)
>Since I'm feeding the resulting source code to a C compiler, the
>missing 'struct' drives the compiler strange. Is there an easy way
>to
>fix the unparser so it outputs the keyword 'struct'? I need this
>badly because I will not be handling C++ code, so using a C++
>compiler
>is not an option.
______
Diego,
I think it would be easy to modify the unparser to do what you want.
I can look into this tomorrow morning. But could you give a more
complete example?
if I try parsing/unparsing a file that contains only:
struct someStruct *f(int){ int j;}
then it unparses to
struct someStruct * f(int ){
int j;
}
Similarly:
struct someStruct;
struct someStruct *f(int){ int j;}
unparses to:
struct someStruct ;
struct someStruct * f(int ){
int j;
}
However,
struct someStruct{int k;};
struct someStruct *f(int){ int j;}
unparses to:
struct someStruct {
int k;
} ;
someStruct * f(int ){
int j;
}
I assume that the last example is how struct is used in your program.
--Beata