[fpc-devel] Where are parser sources?
Jonas Maebe
jonas.maebe at elis.ugent.be
Thu Jan 3 10:42:26 CET 2013
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.
Jonas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20130103/2df84740/attachment.html>
More information about the fpc-devel
mailing list