<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-15">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi all.<br>
<br>
Is there a possiblilty to create an AST for C++ source code which
has a custom entry point.<br>
<br>
To illustrate, the following code expample should be parsed to an
AST:<span style="color: rgb(34, 34, 34); font-family: 'Lucida
Grande', 'Lucida Sans Unicode', Arial, Verdana, Helvetica,
sans-serif; font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: 18px; orphans: 2;
text-align: -webkit-auto; text-indent: 0px; text-transform: none;
white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255); font-size: small; display:
inline !important; float: none; "></span><br>
<br>
<font face="Courier New, Courier, monospace">int z = a + b;<br>
while (z < 10) {<br>
x = x * x;<br>
}</font><br>
<br>
There is no function declaration in the file and not all variables
are declared. Is there a way to create<br>
an AST for this code so that all lexed tokens are parsed into the
AST. <br>
<br>
I tried to do this with the "C" interface libclang but there only a
complete translation unit can be parsed. When i parse<br>
this code i get a some diagnostic messages and the generated AST is
incomplete. <br>
So my question is: is it possible to parse this code in an AST and
if so, whats the best way to do this.<br>
<br>
Thx in advance<br>
Michael Hochgatterer <br>
</body>
</html>