hi there,
to illustrate a little better my current ideas about the refactored
OpenC++ architecture, and to show what I'v been working on in Synopsis
over recent weeks, here is a little UML sketch:
http://synopsis.fresco.org/docs/Tutorial/images/opencxx.png
The central piece is the PTree module. It contains the different building
blocks for the parse tree, which is constructed by the Parser. The parse
tree is inspected by the PTree::Visitor, which is the primary means for
the PTree users to extract information, but which is used by the Parser
internally, too (const expression evaluation, notably).
The AST module ('abstract syntax tree') is basically a convenient
high-level view on the parse tree.
It makes it easy to inspect the code by users, and is conceptually similar
(though quite a bit more expressive) than the current Synopsis AST. It
may replace the latter, or just be an alternative, I'm not sure yet.
The MOP module ('meta object protocol') provides tools to modify the underlaying
code. It can either operate by external rules that express how to replace
existing parse tree nodes by new ones, or it can hook up with tokens
that are embedded into the original source code ('metaclass' comes to mind).
I'm currently working on the PTree module, trying to make the Parser
work 'more correctly', by adding ptree analysis tools such as a symbol
lookup table ('Symbol' and 'Scope' replace 'Binding' and 'Environment',
but are fully independent of 'TypeInfo' and 'Class'), or a const expression
evaluator. These devices will allow to fully disambiguate expressions such as
foo < 1 > (0);
as well as type declarations such as
enum {ONE = 1, TWO};
typedef Array1[2][ONE];
typedef Array2[2][TWO];
I encourage everybody to get involved, the code is documented here:
http://synopsis.fresco.org/docs/Manual/occ/index.html
(you can watch the changelog here: http://synopsis.fresco.org/changelog.html)
Regards,
Stefan
|