<p dir="ltr"><br>
On Sep 20, 2013 8:12 AM, "Alejandro Jimenez" <<a href="mailto:whilealex@gmail.com">whilealex@gmail.com</a>> wrote:<br>
><br>
> Hi everyone<br>
><br>
> I am new to Clang, but I am trying to support the following syntax on variable declaration for a given language.<br>
><br>
> int a : qualifier;</p>
<p dir="ltr">You may find this difficult due to ambiguities (bitfields and range based for loop) with existing c++syntax...</p>
<p dir="ltr">><br>
> float f(int x : qualifier) : qualifier<br>
> {<br>
><br>
> }<br>
><br>
> for qualifier a single word without spaces<br>
><br>
> Which is the best way to approach?<br>
><br>
> I see that there is an ASTConsumer, but didnt found any ParserConsumer, is there anything similar?</p>
<p dir="ltr">Not really. Clang isn't designed to allow pluggable arbitrary language extensions. Astconsumers are just for pluggable language consumers, they don't get to change the language.</p>
<p dir="ltr">If you're changing the language you're going to have to change clang's parsing and sema layers directly.</p>
<p dir="ltr">><br>
><br>
> _______________________________________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
><br>
</p>