[fpc-devel] Dumping the syntax tree
Kostas Michalopoulos
badsectoracula at gmail.com
Fri Oct 24 18:42:54 CEST 2014
I didn't knew about that! This can be very helpful for generating C
compatible interfaces for DLLs.
On Thu, Oct 23, 2014 at 10:36 PM, Michael Van Canneyt <
michael at freepascal.org> wrote:
>
> See the FPC sources:
>
> packages/fcl-passrc/examples/test_parser.pp
>
> Michael.
>
>
> On Thu, 23 Oct 2014, Vsevolod Alekseyev wrote:
>
> What test program, please? Where?
>>
>> On 10/23/2014 4:12 PM, Michael Van Canneyt wrote:
>>
>>>
>>>
>>> You had better use the fcl-passrc units. They dump a complete syntax
>>> tree.
>>> It is used to generate (a currently limited version of) javascript, and
>>> used to create documentation.
>>>
>>> so it should be usable to generate C code...
>>>
>>> The test program re-dumps a pascal program. Presumably you can adapt
>>> that to generate C.
>>>
>>> Michael.
>>>
>>> On Thu, 23 Oct 2014, Kostas Michalopoulos wrote:
>>>
>>> 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
>>>> since most likely you can convert the code to C++ with GNU GCC
>>>> extensions (nested functions, etc) straightforward.
>>>>
>>> _______________________________________________
>>> fpc-devel maillist - fpc-devel at lists.freepascal.org
>>> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
>>>
>>>
>> _______________________________________________
>> fpc-devel maillist - fpc-devel at lists.freepascal.org
>> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
>>
>> _______________________________________________
> fpc-devel maillist - fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20141024/02f4d073/attachment.html>
More information about the fpc-devel
mailing list