One requirement in a transformation into OOP is the replacement of all affected procedures by methods, and of many (currently global) reference variables by class members. When e.g. later multiple parser instances are created, one for every unit to compile, the current compiler directive handling should be redesigned.

Does somebody have experience with (lists of) procedural variables?

I can see these possible solutions for the replacement of procedure references, in e.g. the list of compiler directives:

1) The currently global list is duplicated for every scanner/parser instance, so that it can contain references to the concrete method instances. Fast execution, but more data and setup.

2) The procedure references are modified when actually used, i.e. the instance reference of the method pointer is replaced by the current instance, before the method is called.

3) The procedure references are replaced by directive IDs (enum), with an according case selection in the parser instance.

4) The procedures will not become methods, but will receive an additional instance reference as a parameter. This approach may result in the best SVN history, but may not be usable with threads, later.

Any ideas?

DoDi

_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to