<div dir="ltr"><div>Hi,</div><div><br></div><div>very interesting development, thanks for sharing it.</div><div><br></div><div>Did you consider a more "push-like" approach along with callbacks to decouple and ease integration with existing parsers?</div><div><br></div><div>This way an existing base language parser (say, hypothetically, clang or flang) can push essential tokens that correspond to purely the directive syntax (parallel, for, if, nowait, etc.) and then the OpenMP parser could tell the base language parser "now parse this part of the language you know about".</div><div><br></div><div>For instance, parsing a clause like "num_threads(1+2)". clang could push tokens "num_threads", "(" and then the OpenMP parser (assuming we are deterministic enough!) would let know clang "now parse an expression" which would consume 1+2 and pass the expression (possibly opaquely) to the OpenMP parser. Lastly clang would push ")" and a full num_threads has just been recognized.<br></div><div><br></div><div>To communicate the parser that a part of the OpenMP syntax has been recognized (in this case a num_threads clause) I imagine either a callback could be used or perhaps the push token function could return a result (this is less clear to me, to be honest).</div><div><br></div><div>One limitation of this approach would be that the base language still has to know some OpenMP syntax bits like "a[lower:size]" for C/C++ depend clauses. Declare reduction directive also includes a few special identifiers (like omp_priv) that the base language parser may need to be told about.<br></div><div><br></div><div>Kind regards,<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Missatge de Yonghong Yan via Openmp-dev <<a href="mailto:openmp-dev@lists.llvm.org">openmp-dev@lists.llvm.org</a>> del dia dc., 18 de set. 2019 a les 1:26:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I would like to bring to your attention the ompparser we developed. <a href="https://github.com/passlab/ompparser" target="_blank">https://github.com/passlab/ompparser</a>. We have a IWOMP'19 paper for it and the presentation (<a href="http://parallel.auckland.ac.nz/iwomp2019/slides_ompparser.pdf" target="_blank">http://parallel.auckland.ac.nz/iwomp2019/slides_ompparser.pdf</a>) gives you a quick summary of it. <div><br></div><div>Comments are most welcome. <br><div><br></div><div><div><div dir="ltr" class="gmail-m_9137707316846049951gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Yonghong Yan </div><div dir="ltr">Associate Professor</div><div dir="ltr">Department of Computer Science</div><div dir="ltr">University of North Carolina at Charlotte</div><div dir="ltr">Office: 410F Woodward</div><div dir="ltr">Phone: 704-687-8546</div><div dir="ltr">Email: <a href="mailto:yyan7@uncc.edu" target="_blank">yyan7@uncc.edu</a></div><div dir="ltr"><a href="https://passlab.github.io/yanyh/" target="_blank">https://passlab.github.io/yanyh/</a><br></div></div></div></div></div></div></div></div></div></div></div>
_______________________________________________<br>
Openmp-dev mailing list<br>
<a href="mailto:Openmp-dev@lists.llvm.org" target="_blank">Openmp-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev</a><br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature">Roger Ferrer Ibáñez<br></div>