From users-return-584-apmail-groovy-users-archive=groovy.apache.org@groovy.incubator.apache.org Wed Jul 29 08:40:26 2015 Return-Path: X-Original-To: apmail-groovy-users-archive@minotaur.apache.org Delivered-To: apmail-groovy-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 35A3418F71 for ; Wed, 29 Jul 2015 08:40:26 +0000 (UTC) Received: (qmail 37198 invoked by uid 500); 29 Jul 2015 08:40:16 -0000 Delivered-To: apmail-groovy-users-archive@groovy.apache.org Received: (qmail 37167 invoked by uid 500); 29 Jul 2015 08:40:16 -0000 Mailing-List: contact users-help@groovy.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@groovy.incubator.apache.org Delivered-To: mailing list users@groovy.incubator.apache.org Received: (qmail 37157 invoked by uid 99); 29 Jul 2015 08:40:16 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Jul 2015 08:40:16 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 0B4C4D87F0 for ; Wed, 29 Jul 2015 08:40:16 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.43 X-Spam-Level: X-Spam-Status: No, score=-1.43 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-1.428, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 0ToOnNVnOX1A for ; Wed, 29 Jul 2015 08:40:14 +0000 (UTC) Received: from mail.finkzeit.at (ns.finkzeit.at [62.218.44.2]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 5194321290 for ; Wed, 29 Jul 2015 08:40:14 +0000 (UTC) Received: from fzv1.finkzeit.at ([10.0.0.3]) by mail.finkzeit.at with esmtp (Exim 4.71) (envelope-from ) id 1ZKMuK-0004VD-RR for users@groovy.incubator.apache.org; Wed, 29 Jul 2015 10:40:12 +0200 Received: from fzvnb25.finkzeit.at ([10.0.0.14]) by fzv1.finkzeit.at with esmtpa (Exim 4.54) id 1ZKMuJ-0007Oh-0q for users@groovy.incubator.apache.org; Wed, 29 Jul 2015 10:40:11 +0200 Message-ID: <55B8916B.4000004@finkzeit.at> Date: Wed, 29 Jul 2015 10:40:11 +0200 From: Wolfgang Pedot User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: users@groovy.incubator.apache.org Subject: AST transformation to modify variable names Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Hello, I have the following Scenario: OSGI-based application with embedded GroovyScriptEngines, lots of small(ish) scripts which use variables from the Binding. All those Binding-Variables are written in uppercase (like constants) to distinguish them from locally used variables in the script. While looking into recent increases in compile-time for the scripts I learned that those uppercase variable names are part of the problem because they cause a lot of undesired class-lookups. Modifying all the existing scripts would be a giant pain so I thought there might be a way to do this using an AST transformation, what I would like to do is something like adding a lower-case prefix to all uppercase-variables but I cant seem to find the right angle. Any hints/ideas? Most of the variable-names are known, but some are not. regards Wolfgang Pedot