<div class="gmail_quote">On Tue, Aug 28, 2012 at 6:13 AM, Ali Javadi <span dir="ltr"><<a href="mailto:aj14889@yahoo.com" target="_blank">aj14889@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

I am writing a syntax checker for a new language using the clang front-end. I have added some keywords and some grammar rules, but I don't know how to invoke the tools down to the level of parsing only. I am merely interested in checking the correctness of syntax at the moment.<br>


<br>
I tried ParseAST(), but that returns a NULL pointer for the new type definitions, since their semantics are not defined. What other option do I have?<br></blockquote><div><br></div><div>You could use clang's -fsyntax-only command-line argument to perform only syntactic and semantic analysis steps. There are some other tips here:</div>
<div><br></div><div><a href="http://clang.llvm.org/docs/InternalsManual.html#AddingExprStmt">http://clang.llvm.org/docs/InternalsManual.html#AddingExprStmt</a></div></div>