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

View: New views
15 Messages — Rating Filter:   Alert me  

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

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

Reply to Author | View Threaded | Show Only this Message

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



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

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

Reply to Author | View Threaded | Show Only this Message


     [ http://jira.codehaus.org/browse/JANINO-116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matt Fowles updated JANINO-116:
-------------------------------

    Attachment: janino-full.patch

Updated to account for recent updates to Janino.

> 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



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

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

Reply to Author | View Threaded | Show Only this Message


     [ http://jira.codehaus.org/browse/JANINO-116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matt Fowles updated JANINO-116:
-------------------------------

    Attachment:     (was: janino-full.patch)

> 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



[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 Threaded | Show Only this Message


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

Arno Unkrig commented on JANINO-116:
------------------------------------

Hm... I think it is not correct to have a new syntax element {{StatementList}}. (Java has no "statement list" element.)

Why don't you create the {{StatementList}} tree _outside_ the AST, and when it is complete then "unroll" the {{StatementList}}s' statements into one {{Block}}? That' would just be natural.

> 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



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

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

Reply to Author | View Threaded | Show Only this Message


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

aunkrig edited comment on JANINO-116 at 5/25/08 5:06 PM:
-------------------------------------------------------------

Hm... I think it is not correct to have a new syntax element {{StatementList}}. (Java has no "statement list" element.)

Why don't you create the {{StatementList}} tree _outside_ the AST, and when it is complete then "unroll" the {{StatementList}} s' statements into one {{Block}}? That would only be natural.

      was (Author: aunkrig):
    Hm... I think it is not correct to have a new syntax element {{StatementList}}. (Java has no "statement list" element.)

Why don't you create the {{StatementList}} tree _outside_ the AST, and when it is complete then "unroll" the {{StatementList}}s' statements into one {{Block}}? That' would just be natural.
 

> 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



[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 Threaded | Show Only this Message


    [ 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



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

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

Reply to Author | View Threaded | Show Only this Message


     [ http://jira.codehaus.org/browse/JANINO-116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matt Fowles updated JANINO-116:
-------------------------------

    Attachment: statement-list.patch

The attached patch contains only the additions for {{StatementList}}.  As mentioned, it is vital for my project to be able to inject code at arbitrary points into existing {{Java.Block}} objects.

> 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, statement-list.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



[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 Threaded | Show Only this Message


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

Arno Unkrig commented on JANINO-116:
------------------------------------

Sorry, I still don't quite get it. What keeps you from composing BlockStatements in your own, arbitrarily complex and flexible, and then eventually add them to one big Java.Block, e.g. just before compiling the AST? That would provide for a good isolation between your code composition part and JANINO's data structures.

> 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, statement-list.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



[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 Threaded | Show Only this Message


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

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

Consider the following block of code which is fairly idiomatic of things done in our system.

{code}
public CValue take(StmtContainer block, final CValue value) {
    //take lazily
    final CValue[] taken = new CValue[schema.getFieldCount()];
    final CValue[] values = new CValue[schema.getFieldCount()];
    for(Field f : schema.getFields()) {
        values[f.getIndex()] = createSubValue(value, f);
    }
       
    //use a statement sequence so we inject the code here
    //instead of some later place in the block when ref() gets called
    final CG.StmtSequence stmtSeq = new CG.StmtSequence();
    block.add(stmtSeq);
       
       
    return new CValue(this) {
        @Override
        public Expr ref(int i) {
            if(i == NULL_REF) {
                return value.ref(i);
            }
            int offset = getFieldOffsetForRef(i);
            int remainder = getFieldRefForRef(i);
            if(taken[offset] == null) {
                taken[offset] = values[offset].take(stmtSeq);
            }
            return taken[offset].ref(remainder);
        }
    };
}
{code}

The contract for this method only allows it to insert values into block at the current position (if it were to put them intervening code could change the value of things upon which it depends).  However, we won't necessarily need all of the sub values that could be computed by this block.  Hence the method inserts a place holder item into the block, so that it can always inject code at this point.  Then it lazily fills in the code when it knows which values are needed.

I believe that this sort of a feature would be more generally useful to anyone targeting the Janino AST, and it really does not add much complexity to the Janino 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, statement-list.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



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

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

Reply to Author | View Threaded | Show Only this Message


     [ http://jira.codehaus.org/browse/JANINO-116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matt Fowles updated JANINO-116:
-------------------------------

    Attachment: statement-list.patch

This version also fixes a loop termination issue in {{UnitCompiler.java:1260}}.

> 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: statement-list.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



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

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

Reply to Author | View Threaded | Show Only this Message


     [ http://jira.codehaus.org/browse/JANINO-116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matt Fowles updated JANINO-116:
-------------------------------

    Attachment:     (was: statement-list.patch)

> 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: statement-list.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



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

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

Reply to Author | View Threaded | Show Only this Message


     [ http://jira.codehaus.org/browse/JANINO-116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matt Fowles updated JANINO-116:
-------------------------------

    Attachment:     (was: janino-full.patch)

> 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: statement-list.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



[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 Threaded | Show Only this Message


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

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

Please hold on this patch.  I might have found a refactor that eliminates my need for it, and the presence of it makes some optimizations around findLocalVariable() extremely difficult.

> 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: statement-list.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



[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 Threaded | Show Only this Message


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

Arno Unkrig commented on JANINO-116:
------------------------------------

Let me know about your refactor when you're done!

> 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: statement-list.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



[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 Threaded | Show Only this Message


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

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

I have found a way around this in my code base; however, I still think that this would be a useful feature to have in Janino.  If you are willing to include a patch for this, I would happily provide you with an updated one, as I do believe this adds significant power to the library for compiler writers that target Janino's AST directly.

> 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: statement-list.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