C++ front-end / C++ compiler

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Fri Feb 18 00:27:00 GMT 2000


> we are trying to write a C++ compiler back-end for the GUPRO-Project
> (graphbased program understanding) at the University of
> Koblenz,Germany.

Christian,

I don't know what the requirements for your back-end are, but why
can't you use g++ as-is?

> A C++ front-end that
> - generates AST and symbol table

Depends on what your requirements on the AST are. g++ generates tree
structures (see gcc/tree.def, and gcc/cp/cp-tree.def). Also, gcc 2.95
normally generates them on a per-statement basis, and then throws them
away (unless it is a template). The mainline compiler operates in
function-at-once mode, so it produces an AST for the entire function,
and compiles that.

> - parses ANSI C++ (and dialects: MSVC++, GNU C++, Borland C++)

With restrictions, yes.

> - generates full source code information (line and column numbers,
> type names etc.) that would make it possible to reconstruct the
> source code with our back-end and your front-end

g++ currently does not have column numbers, as that would require
integration with the preprocessor (otherwise, column numbers are
meaningless). Integration with cpplib (thus providing column numbers)
is in progress, but not complete.

> - runs on NT and Solaris

Yes.

> Further information about your front-end (price, support, known bugs,
> how to access the AST, available manuals and docs)
> would be nice.

Hmm. This is a boilerplate request, right? gcc is free software, and
free of charge. In the mainline compiler, gcc/cp/ir.texi explains the
internal representation.

Regards,
Martin



More information about the Gcc mailing list