« Return to Thread: [janino-dev] [jira] Created: (JANINO-116) Need a Java.StatementList for more flexibility in generating ASTs

[janino-dev] [jira] Commented: (JANINO-116) Need a Java.StatementList for more flexibility in generating ASTs

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View in Thread


    [ http://jira.codehaus.org/browse/JANINO-116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=136117#action_136117 ]

Matt Fowles commented on JANINO-116:
------------------------------------

In the project that I am doing the AST is built incrementally.  Consider the following scenario:

Code is creating the AST for a method.  It calls a helper function capable of computing 12 different values.  The helper function inserts a StatementList into the AST, and returns an object that can be queried for these values.  This proxy object is passed around the system for some time, code that knows what to output asks it for only the variables that need to be output.  The helper object uses the statement list to inject the requested variables.

This describes (at a very high level) our compilation strategy for many things.  It allows us to only generate code for the things that we know we will use.  the issue is that someone may inject code on either side of the {{StatementList}} in the {{Block}} to which it belongs.  Hence the need to have something mark the position.

This ability is really vitally important to our code base.

> Need a Java.StatementList for more flexibility in generating ASTs
> -----------------------------------------------------------------
>
>                 Key: JANINO-116
>                 URL: http://jira.codehaus.org/browse/JANINO-116
>             Project: Janino
>          Issue Type: New Feature
>            Reporter: Matt Fowles
>            Assignee: Arno Unkrig
>         Attachments: janino-full.patch
>
>
> StatementLists provide a way to put a place holder statement somewhere, and then fill it in later with only things that are needed.  The big difference between this and a block is that it very explicitly does not introduce a new scope, so that it can be used to inject variables that will be visible.
> The attached patch includes an implementation of this request and tests for it.  It also includes the fixes in:
> http://jira.codehaus.org/browse/JANINO-111
> http://jira.codehaus.org/browse/JANINO-112
> http://jira.codehaus.org/browse/JANINO-113
> http://jira.codehaus.org/browse/JANINO-115
> This flexibility is needed for the inclusion of Janino in my project.  I am nearly finished integrating Janino as our backend bytecode generation system and it is currently passing our nightly test suite of over 9,000 tests with this patch.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


 « Return to Thread: [janino-dev] [jira] Created: (JANINO-116) Need a Java.StatementList for more flexibility in generating ASTs