[fpc-devel] Need advice for refactoring

Florian Klämpfl florian at freepascal.org
Sat Jul 17 11:20:44 CEST 2010

Hans-Peter Diettrich schrieb:
> Since some time I'm trying to separate the syntax from the semantics
> processing in the parser. It turned out to be quite complicated, so that
> I want to use some methodology. (Yes, I've been warned ;-)
> For profiling and debugging I want to have both the old and new code in
> the same executable file

I don't think this is a good idea.

My proposal is:
- make a proof of concept for a part of the parser, e.g. ptype.pas, then
we profile the old and the new compiler with valgrind with code which
stresses this part.
- then we decide if it's worth to continue

> For first results see the dodi/parser_rewrite branch.

Please try to use an indention and coding style as the other compiler
sources do.

I think also that a complete OOP approach should be used and: design it
with multi threading in mind. Having a scanner/parser where multiple
instances can be run at the same time would be a great benefit and I'am
pretty sure that it will make it into fpc trunk.

More information about the fpc-devel mailing list