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
_______________________________________________
fpc-devel maillist - [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel