Re: Continue Eclipse Freemarker DLTK?

Daniel Dekany <[email protected]> Wed, 24 Jul 2013 14:25:44 +0200
Newsgroups gmane.comp.web.freemarker.devel
Message-ID <[email protected]>
Continuing my last answer... (sorry I have inserted a closing sign in
the middle somehow...)


Wednesday, July 24, 2013, 11:21:58 AM, Angelo zerr wrote:

> My idea is to change the FTL.jj
>
> to use a factory which creates template element. So instead to do
> that in the FMParser :
>
> -------------------------------------------------------
> BlockAssignment ba = new BlockAssignment(block, varName, scope, nsExp);
> -------------------------------------------------------
>
> Use a factory :
>
> -------------------------------------------------------
> IBlockAssignment ba = factory.newBlockAssignment(block, varName, scope, nsExp);
> -------------------------------------------------------
>
> IBlockAssignment is an interface. By using a factory gives you the
> capability to use our own structure. For Freemarker, teh factory
> will create IIBlockAssignment with existing IBlockAssignment
> For DLTK, factory will create IIBlockAssignment with
> DLTKIBlockAssignment which will implement DLTK ASTNode.
>
> What do you think about that?

If we will need a such detailed AST then that's probably the good
approach. But as I have written earlier, that's something that should
be avoided, if it can be. I'm not 100% sure it can be avoided, but I
hope it can be.

FM has a quite detailed *internal* AST traversal API since 2.3.20.
It's a nasty one, tries to minimize runtime impact etc., but it's not
for the public so I thought it's OK. So if we could explore what
information is *actually* needed for the DTLK plugin, then I could
implement an API that gives you just that information through a nicer
public API. Maybe in the form of a tree, through the visitor pattern,
for some queries. I don't want to pass in AST nodes, only the
information needed. As you move along, and you realize new things are
needed, the capabilities of this tools API would be extended, and the
point is, it will belong to the FreeMarker project, not to the DLTK
project. So if I add a new feature, it's my responsibility to bring it
up to date. What do you think about this approach?

> Regards Angelo
>


------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk