<div dir="ltr">Hello,<div><br></div><div>I am new to clang and this problem may be so easy, but it took lots of my time. I am writing a source to source translator by clang for translating from my MetaFork language to OpenMP. I want to translate:</div><div>----------------------------------</div><div>meta_for reduction[+: var] (int i=0; i<10; i++)</div><div><br></div><div>to </div><div><br></div><div>#pragma omp parallel for reduction (+: var) </div><div>           for (int i=0; i< 10; i++)</div><div>----------------------------------</div><div>What I did to this point, I defined "meta_for" to be "#pragma omp parallel for for" and managed to add a "tok::eod" between two for's in preprocessor. So now, I can translate <br></div><div><div>----------------------------------</div></div><div><div>meta_for (int i=0; i<10; i++)</div></div><div><br></div><div>to </div><div><br></div><div><div>#pragma omp parallel for </div><div>           for (int i=0; i< 10; i++)</div></div><div><div>----------------------------------</div></div><div><br></div><div>But when I add reduction clause to meta_for, my idea is to comment out " reduction[+: var]" and have a complete parallel for loop, also save the location of reduction clause and operation and variables for later. But when I change the token kind of "reduction", "[", ... , "]" to tok::comment. It gives me a weird error.</div><div><br></div><div>It says  expected to have ")" after "int" to be matched with "("!!!</div><div><br></div><div>can anyone help me on that?</div><div><br></div><div>Thank you. </div><div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div>------<br>----------<br>Masoud Ataei (Mr.)<br><div><div><br></div></div></div></div></div></div></div></div></div></div></div></div>
</div></div>