Re: Simple source translation tool?


Date: Thu, 17 Feb 2000 22:00:31 -0600 (CST)
From: "Andy Glew" <glew@xxxxxxxxxxx>
Subject: Re: Simple source translation tool?
I frequently have need of such tools.
In the past I have hacked GCC and indent.
The problem with such hacks, of course, is that
they grow stale as the language evolves
(indent, for example, was based on pcc,
but drifted over time, and last I looked no longer
handled the full language).

The most recent tool I have used in this regard 
is OpenC++.




----- Original Message ----- 
From: Mihai Christodorescu <mihai@xxxxxxxxxxx>
To: UWisc PL Group Mailing List <pl-seminar@xxxxxxxxxxx>
Sent: Thursday, February 17, 2000 7:13 PM
Subject: Simple source translation tool?


> Hi!
> 
> I am looking for a simple tool that would allow me to perform program
> transformations (from source to source), on C, C++, and Java. The
> transformations I am thinking of are (mostly) orthogonal to existing code,
> such as:
> 
> * insert the code:
> printf( "<function name>\n" );
>   at the beginning of each function in the source file
>   or at the exit point(s) of each function in the source file
> 
> The tool would preferably be a library for reading in the source to some
> kind of AST which I can process/modify and dump to output. Or maybe a tool
> similar to Yacc/bison, that comes with grammars that build ASTs (there
> should be something like this out there, after 20+ years of PL research!)
> I am not looking for efficiency, but rather ease of use (of course, if it
> takes 2 hours to run the transforming program on some input source file,
> then it is no good).
> To this effect, I found something called SAGE++. Before I delve in it, I
> would like to ask you whether you know of any other tools for source code
> transformation, that parse C, C++, and Java, and are accessible from C, C++,
> or Java (i.e. a tool written in Lisp is nice, but not useful to me, for
> now!).
> 
> Thanks,
> 
> Mihai
> 
> PS. BTW, does anyone know of a yacc/bison C++ grammar? I was told that C++
> is not easily yacc-able due to ambiguities in its definition...
> 
> -- 
>  Mihai Christodorescu -=- mihai@xxxxxxxxxxx - http://www.cs.wisc.edu/~mihai
> .---------------------------------------------------------------------------
> |   The man of knowledge must be able not only to love his enemies but also
> | to hate his friends.                                - Friedrich Nietzsche
> `---------------------------------------------------------------------------
> PGP signature block might follow.
> 
> -----BEGIN PGP MESSAGE-----
> Version: PGPfreeware 5.0i for non-commercial use
> MessageID: tVqftY/8ui9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