[ 
https://issues.apache.org/jira/browse/THRIFT-1173?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13043246#comment-13043246
 ] 

alessandro rossi commented on THRIFT-1173:
------------------------------------------

an update:
-I used ctemplate, but this template engine is very poor (no "for"/"if")
-I switched to (modificated) cpptempl 
(https://bitbucket.org/ginstrom/cpptemplate/overview).
 PRO:
 -for / if
 -easy parameter passing
 -only two file (cpptempl.cpp,cpptempl.h)
 -MIT license (is really good?)
 CONS:
 -no else/elif
 -no include
-I'm investigating in order to use flex/bison (I used them about 15 years ago 
:P ) for a new simple-but-powerful template engine without lib dependancies 
(thrift already use flex/bison for its grammar).
the new template engine MUST have:
-for/if/else/elif/switch-case
-function
-include

PS: I'm working to python generator using cpptempl and the code lines now are 
2240 (original 2390). It's heavy to pass for embedded-code to template-code.


> Using template system (for example: ctemplate) for code generation
> ------------------------------------------------------------------
>
>                 Key: THRIFT-1173
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1173
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (General)
>    Affects Versions: 0.6.1
>            Reporter: alessandro rossi
>            Priority: Minor
>              Labels: generation, template
>
> IMHO, the code generation embedded into generator's code is not a good 
> solution.
> With ctemplate (http://code.google.com/p/google-ctemplate/), for example, we 
> can separate logic with generation code.
> If you want I can implement an example for cpp generator.
> Best Regards,
> Alessandro

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to