Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ptp-dev] Detecting pragma into CDT files

Yes the OpenMP code for detecting #pragmas (and the rest of the OpenMP analysis) was written several years ago, before the CDT AST had #pragma nodes in it.
So I think what we do now is wrapper the CDT #pragma nodes with our original classes, so that may confuse things a bit. It would be simpler if we were to rewrite it today.
You could ask on the cdt-dev list and probably find a more direct route for finding #pragmas than what we've done here in PLDT.

Have you tried using the CDT's DOM AST view? It's helpful for learning about the CDT's AST nodes.
Install the "CDT Testing Feature" and then open the CDT's "DOM AST View" to see an AST tree view of whatever the editor is open on.
I haven't looked at that view in a while, and the #pragma of a small sample program didn't seem to show up there. Hmmmm.

Also, if you look at a talk from EclipseCon last year: http://www.eclipsecon.org/2008/?page=sub/&id=373
It has some hints about configuring the ASTs that are built - e.g. you have to give an extra argument to get the comments.
Now I wonder if there's an extra argument to get the preprocessor statements too. (ASTVisitor.shouldVisitXXXXX etc)
Ah yes, slide 6 reminds me that there is an IASTPreprocessorPragmaStatement node (which didn't exist when we first wrote our OpenMP analysis code in PLDT)
Slide 8 shows you the DOM AST view; Slide 11 shows how to use ast.getAllPreprocessorStatements();
Hopefully that helps you get started.


...Beth

Beth Tibbitts (859) 243-4981 (TL 545-4981)
High Productivity Tools / Parallel Tools http://eclipse.org/ptp
IBM T.J.Watson Research Center
Mailing Address: IBM Corp., 745 West New Circle Road, Lexington, KY 40511

Inactive hide details for "Georges Bossert" ---11/02/2008 09:55:40 AM---Hello everyone,"Georges Bossert" ---11/02/2008 09:55:40 AM---Hello everyone,

          "Georges Bossert" <gbossert@xxxxxxxxx>
          Sent by: ptp-dev-bounces@xxxxxxxxxxx

          11/02/2008 09:53 AM

          Please respond to
          Parallel Tools Platform general developers <ptp-dev@xxxxxxxxxxx>

To

<ptp-dev@xxxxxxxxxxx>

cc


Subject

[ptp-dev] Detecting pragma into CDT files

Hello everyone,

I’m currently working on an extension for PLDT which will support a new Parallel language.
The plugin is still in dev. and I’m waiting for help since I’m blocking on a problem.
I’ve extended PldtAstVisitor but with the method : visit(IASTExpression exp)
I can’t reach pragmas inserted in files.
In fact I tried this :
If (exp instanceof IASTPreprocessorStatement) but it’s not working ( I have no results ).

I think I’m trying to access from the wrong place but I don’t know where and how to do so.
How would you do that.

I’ve read the source code of OPENMP and I saw that the author has created his own PAST to provide an easy access to pragmas from an AST.

Thank you in advance for your precious help


Georges Bossert
+33 (0)6.03.57.53.88
gbossert@xxxxxxxxx

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


GIF image

GIF image

GIF image


Back to the top