This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gomp] Parser for OpenMP directives


"Joseph S. Myers" <joseph@codesourcery.com> writes:

> I concur with Zack's view that cpplib should end up expanding all
> non-ignored pragmas as a token sequence (with or without macro
> expansion) which is then parsed by the parser however it likes.
> This would start with a special token for #pragma, end with a
> special token for the end of a #pragma (I prefer such a special
> token to ending with an ordinary ';' token) and inbetween have the
> tokens of the pragma.

Why the special ending token?  I'm not aware of any situation where we
need ';' in the middle of a pragma's arguments.

> The pragma namespace ("GCC", "STDC", "omp") might or might not be a
> property of the #pragma special token rather than a separate token,
> as might the following identifier naming the pragma in question.

Since cpplib already has a bunch of machinery for mapping a pragma
namespace + operation identifier to a callback routine, my inclination
would be to continue to use this, and have the token value of the
"__pragma" keyword be a pointer to the appropriate callback.

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]