[svn:parrot] r38367 - branches/pmc_pct/compilers/pmc

bacek at svn.parrot.org bacek at svn.parrot.org
Sun Apr 26 10:42:10 UTC 2009


Author: bacek
Date: Sun Apr 26 10:42:09 2009
New Revision: 38367
URL: https://trac.parrot.org/parrot/changeset/38367

Log:
Add implementation plan.

Added:
   branches/pmc_pct/compilers/pmc/DOTPLAN.pod

Added: branches/pmc_pct/compilers/pmc/DOTPLAN.pod
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/pmc_pct/compilers/pmc/DOTPLAN.pod	Sun Apr 26 10:42:09 2009	(r38367)
@@ -0,0 +1,89 @@
+## $Id$
+
+=head1 .PLAN
+
+How I'm going to implement it.
+
+=head2 AST
+
+PCT's PAST nodes are not very suitable. Actually I'm too dumb to figure out
+how to use them (thanks wayland). So I'm going to extend PAST with few
+additional classes:
+
+=over 4
+
+=item C<PMC::AST::Class>
+
+Main PMC class which stores vtable methods, PCC methods, c_header and
+c_footer. Inherited from C<PAST::Block>
+
+=item PMC::AST::VTableMethod
+
+Single vtable method. Inherited from C<PAST::Block>. 
+
+=item PMC::AST::Method
+
+Single PCC method. Inherited from C<PAST::Block>.
+
+=back
+
+=head2 Emitting
+
+Emitting will be represented by C<PMC::Emitter> class and use I<Visitor>
+patter (think multimethods) for emitting various files.
+
+Classes:
+
+=over 4
+
+=item C<PMC::Emitter>
+
+Main emitter Facade. 
+
+=item C<PMC::Emitter::PMC>
+
+Generic PMC emitter.
+
+=item C<PMC::Emitter::PMC::*>
+
+Classes used for specific PMC emitting. In Pmc2c there is C<Object>, C<Null>
+and C<default> used. So I'll probably have something like this.
+
+=back
+
+=head2 src/vtable.tbl
+
+During parsing and emitting we will need list of all vtable methods. In
+current parrot all vtable-related files generated by various scripts using
+C<lib/Parrot/Vtable.pm>. Initially I will generate C<PMC::VTable> class
+manually (fsvo) which will contains available VTable functions, etc. Next step
+will be generate C<PMC::VTable> class using PCT.
+
+=head2 NEXT STEP IN PARSING
+
+Initially parsing of C-function bodies will be pretty dumb. It will just
+consume whole body. Next steps will be:
+
+=over 4
+
+=item *
+
+Parse current PMC "pseudo-C" language for various C<SELF>, C<SUPER> and other
+macros.
+
+=item *
+
+Emit proper C-code from parsed statements.
+
+=back
+
+=head1 AUTHORS
+
+Vasily "bacek" Chekalkin is creator of initial version.
+
+=head1 COPYRIGHT
+
+Copyright (C) 2009, Parrot Foundation.
+
+=cut
+


More information about the parrot-commits mailing list