Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 49023 invoked from network); 27 Feb 2006 03:12:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 27 Feb 2006 03:12:11 -0000 Received: (qmail 92694 invoked by uid 500); 27 Feb 2006 03:12:09 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 92601 invoked by uid 500); 27 Feb 2006 03:12:09 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 92590 invoked by uid 500); 27 Feb 2006 03:12:09 -0000 Received: (qmail 92586 invoked by uid 99); 27 Feb 2006 03:12:09 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Feb 2006 19:12:09 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Sun, 26 Feb 2006 19:12:08 -0800 Received: (qmail 48937 invoked by uid 65534); 27 Feb 2006 03:11:48 -0000 Message-ID: <20060227031148.48936.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r381240 - /jakarta/commons/proper/jexl/trunk/src/java/org/apache/commons/jexl/parser/ASTBlock.java Date: Mon, 27 Feb 2006 03:11:47 -0000 To: commons-cvs@jakarta.apache.org From: dion@apache.org X-Mailer: svnmailer-1.0.7 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: dion Date: Sun Feb 26 19:11:43 2006 New Revision: 381240 URL: http://svn.apache.org/viewcvs?rev=381240&view=rev Log: Implement Block. { statement* } value of the block is the value of the last statement Modified: jakarta/commons/proper/jexl/trunk/src/java/org/apache/commons/jexl/parser/ASTBlock.java Modified: jakarta/commons/proper/jexl/trunk/src/java/org/apache/commons/jexl/parser/ASTBlock.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/jexl/trunk/src/java/org/apache/commons/jexl/parser/ASTBlock.java?rev=381240&r1=381239&r2=381240&view=diff ============================================================================== --- jakarta/commons/proper/jexl/trunk/src/java/org/apache/commons/jexl/parser/ASTBlock.java (original) +++ jakarta/commons/proper/jexl/trunk/src/java/org/apache/commons/jexl/parser/ASTBlock.java Sun Feb 26 19:11:43 2006 @@ -1,7 +1,24 @@ /* Generated By:JJTree: Do not edit this line. ASTBlock.java */ +/* + * Copyright 2002,2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.commons.jexl.parser; +import org.apache.commons.jexl.JexlContext; + public class ASTBlock extends SimpleNode { public ASTBlock(int id) { super(id); @@ -16,4 +33,19 @@ public Object jjtAccept(ParserVisitor visitor, Object data) { return visitor.visit(this, data); } + + /** + * return the value of the block + */ + public Object value(JexlContext context) throws Exception + { + int numChildren = jjtGetNumChildren(); + Object result = null; + for(int i = 0; i < numChildren; i++) + { + result = ((SimpleNode) jjtGetChild(i)).value(context); + } + return result; + } + } --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org