gomp-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Gomp-discuss] Re: Lexing and parsing OMP directives, again


From: S. Bosscher
Subject: RE: [Gomp-discuss] Re: Lexing and parsing OMP directives, again
Date: Wed, 09 Jul 2003 22:16:43 +0200

[ CC: Zack next time, he is not on this list I think...  ]

Zack Weinberg wrote:
> > You've correctly understood my suggestion.  I had in mind that cpplib
> > would, upon encountering a #pragma, first check whether it was a
> > #pragma that affects preprocessor behavior.  If not, it would inject
> > the token __builtin_pragma into its output stream, then pass all the
> > tokens following the #pragma on unchanged, and finally inject a ;
> > token at the end of the directive line.
> >
> > The C parser would then interpret __builtin_pragma as a _keyword_,
> and
> > expect a stream of tokens following - with whatever syntax and
> > semantics are necessary - until it reached the trailing semicolon, at
> > which point it would go back to the normal grammar.
> 
> As I understand it, what you're suggesting is that cpplib would 
> translate OpenMP pragmas into internally-defined language extensions 
> handled by later stages of the compile.

All pragma, actually.

> > C99's _Pragma() would get the same treatment, except that its argument
> > would be unstringified first.
> 
> So it sounds like any work required to implement OpenMP will also be 
> applicable implementing C99. Nice and synergistic.

Actually, _Pragma() has to be unstringified now too, so no changes here,
right?


Anyway, I mailed Neil about his C recursive-descent parser, and it is more
or less on hold while he's doing options handling and cpplib work.  That is
a real shame :-(

Zack, is there any way to still pass pragmas as a stream of tokens, but
intercept them in c_lex for the YACC parsers so they doesn't have to deal
with them?  I think that the existing supported pragmas are simple enough
that a pragma handler could be called from c_lex.  That way, we could feed
pragmas as tokens to the C++ parser (is that called phase 7 for C++ too?)
while hiding them for the C/ObjC parsers.
(Or does java use cpplib too???)

Gr.
Steven




reply via email to

[Prev in Thread] Current Thread [Next in Thread]