001    /*
002     * Copyright 2003 (C) Sam Pullara. All Rights Reserved.
003     * 
004     * Redistribution and use of this software and associated documentation
005     * ("Software"), with or without modification, are permitted provided that the
006     * following conditions are met: 1. Redistributions of source code must retain
007     * copyright statements and notices. Redistributions must also contain a copy
008     * of this document. 2. Redistributions in binary form must reproduce the above
009     * copyright notice, this list of conditions and the following disclaimer in
010     * the documentation and/or other materials provided with the distribution. 3.
011     * The name "groovy" must not be used to endorse or promote products derived
012     * from this Software without prior written permission of The Codehaus. For
013     * written permission, please contact info@codehaus.org. 4. Products derived
014     * from this Software may not be called "groovy" nor may "groovy" appear in
015     * their names without prior written permission of The Codehaus. "groovy" is a
016     * registered trademark of The Codehaus. 5. Due credit should be given to The
017     * Codehaus - http://groovy.codehaus.org/
018     * 
019     * THIS SOFTWARE IS PROVIDED BY THE CODEHAUS AND CONTRIBUTORS ``AS IS'' AND ANY
020     * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
021     * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
022     * DISCLAIMED. IN NO EVENT SHALL THE CODEHAUS OR ITS CONTRIBUTORS BE LIABLE FOR
023     * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
024     * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
025     * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
026     * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
027     * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
028     * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
029     * DAMAGE.
030     *  
031     */
032    package org.codehaus.groovy.ast.expr;
033    
034    import org.codehaus.groovy.ast.GroovyCodeVisitor;
035    
036    /**
037     * @author sam
038     */
039    public class NotExpression extends BooleanExpression {
040    
041            public NotExpression(Expression expression) {
042                    super(expression);
043            }
044    
045            public void visit(GroovyCodeVisitor visitor) {
046                    visitor.visitNotExpression(this);
047            }
048    
049        public boolean isDynamic() {
050            return false;
051        }
052    
053        public Expression transformExpression(ExpressionTransformer transformer) {
054            Expression ret = new NotExpression(transformer.transform(getExpression())); 
055            ret.setSourcePosition(this);
056            return ret;
057            }
058    }