[fpc-devel] Where are parser sources?
Sven Barth
pascaldragon at googlemail.com
Fri Jan 4 13:31:15 CET 2013
Am 04.01.2013 12:51, schrieb Anton Kavalenka:
> On 03.01.2013 12:42, Jonas Maebe wrote:
>>
>> On 03 Jan 2013, at 07:52, Andrzej Borucki wrote:
>>
>>> I look to fpc-2.6.0.source.zip, directory fpc-2.6.0\compiler. I see
>>> array
>>> arraytokeninfo in file tokens.pas where are keywords like 'repeat' and
>>> 'until'. But I can't find any parser (and lexer, dfa etc). How
>>> FreePascal
>>> compiler proceed with grammar?
>>
>> The lexer is mostly in scanner.pas
>>
>> The parser is in pbase.pas (base parser routines), pstatmnt.pas
>> (parsing statements), pexpr.pas (parsing expressions), pdecl.pas
>> (generic declaration parsing), pdecvar.pas (parsing variable and
>> property declarations), pdecsub.pas (parsing procedure/method
>> declarations), pdecobj.pas (parsing object/class declarations),
>> ptype.pas (generic type parsing).
>>
>> The parser is a manually written recursive-descent parser. There is
>> no formal grammar.
>
>
> Dear Jonas,
>
> could you point me where is $R directive is handled , I'd like to make
> patch for
> http://bugs.freepascal.org/view.php?id=20652
While I'm not Jonas I can answer you nevertheless: the file is
$fpcdir/compiler/scandir.pas in the procedure "dir_resource".
Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20130104/1dd987b2/attachment.html>
More information about the fpc-devel
mailing list