>>>>> "John" ==   <[EMAIL PROTECTED]> writes:

John> I have recently been introduced to the wonders of TT and would like to migrate a 
substantial amount of existing CPP (C pre-processor) code to it.  It would appear that 
I have four choices:

John> 1) Find an existing translator which will take CPP and spit out TT.
John> 2) Find an existing TT plug which causes TT to accept CPP syntax (i.e. emulate 
CPP).
John> 3) Code up either 1) or 2) myself.
John> 4) Change lots of files by hand.

John> Clearly, 1) and 2) would be favourite :-)

You might look at Text::CPP and either build a plugin around it,
or look at how it is doing things.

As for translating CPP to Template... I'm not sure it could be done
mechanically without a lot of work.  Consider:

    #define message This is the FOO place
    #define FOO bar
    message

vs

    #define message This is the FOO place
    message

vs

    #define message This is the FOO place
    #define This That
    message
    #undef This
    #define FOO bar
    message

You'd have to replace every /\w+/ with something that would look up
whether or not there was a current definition at rendering time, because
it could be changed.  Ick.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to