<div dir="ltr">I didn't knew about that! This can be very helpful for generating C compatible interfaces for DLLs.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 23, 2014 at 10:36 PM, Michael Van Canneyt <span dir="ltr"><<a href="mailto:michael@freepascal.org" target="_blank">michael@freepascal.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
See the FPC sources:<br>
<br>
packages/fcl-passrc/examples/<u></u>test_parser.pp<span class="HOEnZb"><font color="#888888"><br>
<br>
Michael.</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
On Thu, 23 Oct 2014, Vsevolod Alekseyev wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
What test program, please? Where?<br>
<br>
On 10/23/2014 4:12 PM, Michael Van Canneyt wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
You had better use the fcl-passrc units. They dump a complete syntax tree.<br>
It is used to generate (a currently limited version of) javascript, and used to create documentation.<br>
<br>
so it should be usable to generate C code...<br>
<br>
The test program re-dumps a pascal program. Presumably you can adapt that to generate C.<br>
<br>
Michael.<br>
<br>
On Thu, 23 Oct 2014, Kostas Michalopoulos wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Lazarus has a Pascal tokenizer unit under components\mpaslex\mpaslex.pp. It seems old and doesn't look like it supports the full FPC syntax, but it might be a starting point<br>
since most likely you can convert the code to C++ with GNU GCC extensions (nested functions, etc) straightforward.<br>
</blockquote>
______________________________<u></u>_________________<br>
fpc-devel maillist - <a href="mailto:fpc-devel@lists.freepascal.org" target="_blank">fpc-devel@lists.freepascal.org</a><br>
<a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel" target="_blank">http://lists.freepascal.org/<u></u>cgi-bin/mailman/listinfo/fpc-<u></u>devel</a><br>
<br>
</blockquote>
<br>
______________________________<u></u>_________________<br>
fpc-devel maillist - <a href="mailto:fpc-devel@lists.freepascal.org" target="_blank">fpc-devel@lists.freepascal.org</a><br>
<a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel" target="_blank">http://lists.freepascal.org/<u></u>cgi-bin/mailman/listinfo/fpc-<u></u>devel</a><br>
<br>
</blockquote>
______________________________<u></u>_________________<br>
fpc-devel maillist - <a href="mailto:fpc-devel@lists.freepascal.org" target="_blank">fpc-devel@lists.freepascal.org</a><br>
<a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel" target="_blank">http://lists.freepascal.org/<u></u>cgi-bin/mailman/listinfo/fpc-<u></u>devel</a><br>
</div></div></blockquote></div><br></div>