Return-Path: X-Original-To: apmail-flex-users-archive@www.apache.org Delivered-To: apmail-flex-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 909CA115F1 for ; Mon, 30 Jun 2014 16:59:17 +0000 (UTC) Received: (qmail 59816 invoked by uid 500); 30 Jun 2014 16:59:17 -0000 Delivered-To: apmail-flex-users-archive@flex.apache.org Received: (qmail 59784 invoked by uid 500); 30 Jun 2014 16:59:17 -0000 Mailing-List: contact users-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@flex.apache.org Delivered-To: mailing list users@flex.apache.org Received: (qmail 59773 invoked by uid 99); 30 Jun 2014 16:59:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Jun 2014 16:59:16 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_HELO_PASS X-Spam-Check-By: apache.org Received-SPF: unknown (athena.apache.org: error in processing during lookup of aharui@adobe.com) Received: from [207.46.163.203] (HELO na01-bl2-obe.outbound.protection.outlook.com) (207.46.163.203) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Jun 2014 16:59:11 +0000 Received: from BL2PR02MB500.namprd02.prod.outlook.com (10.141.95.147) by BL2PR02MB498.namprd02.prod.outlook.com (10.141.95.142) with Microsoft SMTP Server (TLS) id 15.0.974.11; Mon, 30 Jun 2014 16:58:31 +0000 Received: from BL2PR02MB500.namprd02.prod.outlook.com ([10.141.95.147]) by BL2PR02MB500.namprd02.prod.outlook.com ([10.141.95.147]) with mapi id 15.00.0974.002; Mon, 30 Jun 2014 16:58:31 +0000 From: Alex Harui To: "users@flex.apache.org" Subject: RE: ActionScript AST Thread-Topic: ActionScript AST Thread-Index: AQHPkUQpLgC7ZFn1FkS9hOGoiFU3S5uD/eSAgAFgGgCABGB9gIAAJ4N7 Date: Mon, 30 Jun 2014 16:58:31 +0000 Message-ID: <8c100f4784f444348e7c51ccb4fc1e29@BL2PR02MB500.namprd02.prod.outlook.com> References: <53AC1E6B.1010406@crispico.com>, ,<53B175A3.1090306@crispico.com> In-Reply-To: <53B175A3.1090306@crispico.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [166.137.219.203] x-microsoft-antispam: BCL:0;PCL:0;RULEID: x-forefront-prvs: 0258E7CCD4 x-forefront-antispam-report: SFV:NSPM;SFS:(979002)(6009001)(479174003)(377454003)(51704005)(24454002)(189002)(199002)(33646001)(92566001)(2351001)(107886001)(107046002)(95666004)(19580395003)(83322001)(19580405001)(93886003)(105586002)(106356001)(31966008)(86362001)(74662001)(85306003)(21056001)(101416001)(4396001)(83072002)(74502001)(85852003)(74316001)(76176999)(50986999)(54356999)(99396002)(77982001)(79102001)(76576001)(46102001)(76482001)(80022001)(87936001)(221733001)(66066001)(2656002)(20776003)(81542001)(106116001)(64706001)(99286002)(81342001)(108616002)(24736002)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:;SCL:1;SRVR:BL2PR02MB498;H:BL2PR02MB500.namprd02.prod.outlook.com;FPR:;MLV:ovrnspm;PTR:InfoNoRecords;MX:1;LANG:en; Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: adobe.com X-Virus-Checked: Checked by ClamAV on apache.org Hopefully Gordon will reply as he knows this code better. I haven't had to= do much AST surgery. I do want to point out that in the FalconJX project, the AST code generatio= n is done differently. There is no ABC output for FalconJX but it would be= interesting to have one in order to compare performance against the BURM t= he regular Falcon project uses. Output hacking might be easier in FalconJX= . -Alex=20 ________________________________________ From: Mariana Gheorghe [mariana.gheorghe@crispico.com] Sent: Monday, June 30, 2014 7:35 AM To: users@flex.apache.org Subject: Re: ActionScript AST Thank you both for the suggestion, we've started using Falcon, and indeed, it seems that the AST is much easier to use, and the code is well documented. So far, we have obtained the AST for an AS file, and now we are looking for a way to do rewriting. We want to be able to make modifications to the AST (e.g. change the return type of a function, add a parameter), and then generate the AS code to show these modifications (i.e. with the new return type or parameter etc). Is there any functionality already implemented in Falcon that would help us achieve this? E.g. listening to AST changes, generating AS code from an AST node. Any hints would be appreciated! Mariana On 27.06.2014 22:44, Gordon Smith wrote: > I agree that you should investigate using Falcon. think you'll find that = the classes making up Falcon's AST are reasonably intuitive and have good J= avadoc documentation. > > If you get Falcon compiling in Eclipse and run a compile in Debug mode, y= ou'll see an indented tree-like representation of the AST whenever you insp= ect an AST node instance. > > - Gordon > >> From: aharui@adobe.com >> To: users@flex.apache.org >> Subject: Re: ActionScript AST >> Date: Fri, 27 Jun 2014 05:44:50 +0000 >> >> >> >> On 6/26/14 6:21 AM, "Mariana Gheorghe" >> wrote: >> >>> Hello, >>> >>> We are looking for a way to obtain and rewrite the AST (abstract syntax >>> tree) for an AS file. Currently, we are using the compiler library that >>> comes with the SDK, and we've obtained the AST rooted at a ProgramNode. >>> We are now unsure on how to proceed to: a) make modifications to the >>> tree (e.g. add a variable, add a parameter to a function), and b) >>> generate the code from a (modified) tree. Any hints on how to do this >>> would be appreciated! >> I find the MXMLC code to be very difficult. >> >>> Also, we were wondering about the status of Falcon, and if we should in >>> fact use Falcon to obtain/rewrite the AST, instead of the compiler from >>> the SDK. >> Falcon has released a 0.0.1 alpha, we'll ship a 0.0.2 soon. I find the >> code base much easier to work with. >> >> -Alex >> >