[cfe-dev] Disable type checking on identifiers for parse?

Sean Silva silvas at purdue.edu
Tue Jun 12 23:35:45 PDT 2012


Sadly, it is impossible to correctly parse C++ (and C also I believe)
without being aware of types.

--Sean Silva

On Tue, Jun 12, 2012 at 9:57 PM, andrewh <andrewaah at gmail.com> wrote:

> In my program I'm placing a macro function body into a normal function body
> so that the macro will be expanded and if there are no syntax errors,
> generate an ast of it.
> e.g:
> #define macronum 5
> #define macrofunc(x,y) x+y*macronum
> void func(char *x, char *y) {macrofunc(x,y);}
>
> expanding into:
> void func(char *x, char *y) {x+y*5;}
> to get an ast like: (+ x (* y 5))
>
> I won't know the param types, so I was hoping to skip the type checking.
>
> Is this possible? e.g. by doing something with the 'Sema' or 'Parser'
> classes?
>
> Thanks.
>
>
> --
> View this message in context:
> http://clang-developers.42468.n3.nabble.com/Disable-type-checking-on-identifiers-for-parse-tp4024483.html
> Sent from the Clang Developers mailing list archive at Nabble.com.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120612/e2fcf192/attachment.html>


More information about the cfe-dev mailing list