View Javadoc

    1   /*
    2
    3    $Id: GroovyCodeVisitor.java 3891 2006-07-07 10:49:57Z blackdrag $
    4
    5
    6
    7    Copyright 2003 (C) James Strachan and Bob Mcwhirter. All Rights Reserved.
    8
    9
    10
    11   Redistribution and use of this software and associated documentation
    12
    13   ("Software"), with or without modification, are permitted provided
    14
    15   that the following conditions are met:
    16
    17
    18
    19   1. Redistributions of source code must retain copyright
    20
    21      statements and notices.  Redistributions must also contain a
    22
    23      copy of this document.
    24
    25
    26
    27   2. Redistributions in binary form must reproduce the
    28
    29      above copyright notice, this list of conditions and the
    30
    31      following disclaimer in the documentation and/or other
    32
    33      materials provided with the distribution.
    34
    35
    36
    37   3. The name "groovy" must not be used to endorse or promote
    38
    39      products derived from this Software without prior written
    40
    41      permission of The Codehaus.  For written permission,
    42
    43      please contact info@codehaus.org.
    44
    45
    46
    47   4. Products derived from this Software may not be called "groovy"
    48
    49      nor may "groovy" appear in their names without prior written
    50
    51      permission of The Codehaus. "groovy" is a registered
    52
    53      trademark of The Codehaus.
    54
    55
    56
    57   5. Due credit should be given to The Codehaus -
    58
    59      http://groovy.codehaus.org/
    60
    61
    62
    63   THIS SOFTWARE IS PROVIDED BY THE CODEHAUS AND CONTRIBUTORS
    64
    65   ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
    66
    67   NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
    68
    69   FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
    70
    71   THE CODEHAUS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
    72
    73   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
    74
    75   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
    76
    77   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    78
    79   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
    80
    81   STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
    82
    83   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
    84
    85   OF THE POSSIBILITY OF SUCH DAMAGE.
    86
    87
    88
    89   */
    90
    91  package org.codehaus.groovy.ast;
    92
    93
    94
    95  import org.codehaus.groovy.ast.expr.*;
    96
    97  import org.codehaus.groovy.ast.stmt.*;
    98
    99
    100
    101 /***
    102
    103  * An implementation of the visitor pattern for working with ASTNodes
    104
    105  *
    106
    107  * @author <a href="mailto:james@coredevelopers.net">James Strachan</a>
    108
    109  * @version $Revision: 3891 $
    110
    111  */
    112
    113 public interface GroovyCodeVisitor {
    114
    115
    116
    117     // statements
    118
    119     //-------------------------------------------------------------------------
    120
    121     public void visitBlockStatement(BlockStatement statement);
    122
    123     public void visitForLoop(ForStatement forLoop);
    124
    125     public void visitWhileLoop(WhileStatement loop);
    126
    127     public void visitDoWhileLoop(DoWhileStatement loop);
    128
    129     public void visitIfElse(IfStatement ifElse);
    130
    131     public void visitExpressionStatement(ExpressionStatement statement);
    132
    133     public void visitReturnStatement(ReturnStatement statement);
    134
    135     public void visitAssertStatement(AssertStatement statement);
    136
    137     public void visitTryCatchFinally(TryCatchStatement finally1);
    138
    139     public void visitSwitch(SwitchStatement statement);
    140
    141     public void visitCaseStatement(CaseStatement statement);
    142
    143     public void visitBreakStatement(BreakStatement statement);
    144
    145     public void visitContinueStatement(ContinueStatement statement);
    146
    147     public void visitThrowStatement(ThrowStatement statement);
    148
    149     public void visitSynchronizedStatement(SynchronizedStatement statement);
    150
    151     public void visitCatchStatement(CatchStatement statement);
    152
    153
    154
    155     // expressions
    156
    157     //-------------------------------------------------------------------------
    158
    159     public void visitMethodCallExpression(MethodCallExpression call);
    160
    161     public void visitStaticMethodCallExpression(StaticMethodCallExpression expression);
    162
    163     public void visitConstructorCallExpression(ConstructorCallExpression expression);
    164
    165     public void visitTernaryExpression(TernaryExpression expression);
    166
    167     public void visitBinaryExpression(BinaryExpression expression);
    168
    169     public void visitPrefixExpression(PrefixExpression expression);
    170
    171     public void visitPostfixExpression(PostfixExpression expression);
    172
    173     public void visitBooleanExpression(BooleanExpression expression);
    174
    175     public void visitClosureExpression(ClosureExpression expression);
    176
    177
    178
    179     public void visitTupleExpression(TupleExpression expression);
    180
    181     public void visitMapExpression(MapExpression expression);
    182
    183     public void visitMapEntryExpression(MapEntryExpression expression);
    184
    185     public void visitListExpression(ListExpression expression);
    186
    187     public void visitRangeExpression(RangeExpression expression);
    188
    189
    190
    191     public void visitPropertyExpression(PropertyExpression expression);
    192
    193     public void visitAttributeExpression(AttributeExpression attributeExpression);
    194
    195     public void visitFieldExpression(FieldExpression expression);
    196
    197     public void visitMethodPointerExpression(MethodPointerExpression expression);
    198
    199
    200
    201     public void visitConstantExpression(ConstantExpression expression);
    202
    203     public void visitClassExpression(ClassExpression expression);
    204
    205     public void visitVariableExpression(VariableExpression expression);
    206
    207     public void visitDeclarationExpression(DeclarationExpression expression);
    208
    209     public void visitRegexExpression(RegexExpression expression);
    210
    211     public void visitGStringExpression(GStringExpression expression);
    212
    213     public void visitArrayExpression(ArrayExpression expression);
    214
    215
    216
    217     public void visitSpreadExpression(SpreadExpression expression);
    218
    219     public void visitSpreadMapExpression(SpreadMapExpression expression);
    220     public void visitNotExpression(NotExpression expression);
    221
    222     public void visitNegationExpression(NegationExpression expression);
    223
    224     public void visitBitwiseNegExpression(BitwiseNegExpression expression);
    225
    226     public void visitCastExpression(CastExpression expression);
    227
    228
    229     public void visitArgumentlistExpression(ArgumentListExpression expression);
    230 }
    231