Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Source-to-source compiler based on CDT

CDT AST should represent gcc attributes. It simply hasn't been done yet. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=316230. Design and code contributions are welcome.

-sergey

On Thu, May 26, 2011 at 3:08 PM, Gerrit Telkamp <g.telkamp@xxxxxxxxxxxx> wrote:
Hello all,

we've tried to create a source-to-source compiler to be used for code transformation issues, based on the current CDT parser (org.eclipse.cdt.core.dom.ast.gnu.c.GCCLanguage, current SVN trunk).
For the AST writer, we started with the ASTWriterVisitor and modified it step-by-step to print out the full GNU-C language set.

So far, so good - this worked. But then we found out that the GNU-C keyword "__attribute__" is parsed, but not stored into the CDT AST. Hence, we are not able to rewrite __attribute__ to our C output stream.  Reading the source code of the CDT parser "GCCLanguage", class AbstractGNUSourceCodeParser (method: attribute__()), it becomes clear that this keyword is is consumed, but not processed. Because we need __attribute__ in our C code, this is a blocker for us.

Is there someone who knows an extension or an alternative for the CDT-parser "GCCLanguage" to solve this? Or is it planned to extend the AST by the keyword "__attribute__" ?

Thank you in advance & best regards

Gerrit.


_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev



Back to the top