001 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
002 // for details. All rights reserved. Use of this source code is governed by a
003 // BSD-style license that can be found in the LICENSE file.
004
005 package com.google.dart.compiler.backend.js.ast;
006
007 import com.google.dart.compiler.backend.js.ast.JsVars.JsVar;
008
009 import java.util.List;
010
011 public abstract class JsVisitor {
012 public <T extends JsNode> void accept(T node) {
013 node.accept(this);
014 }
015
016 public final <T extends JsNode> void acceptList(List<T> collection) {
017 for (T node : collection) {
018 accept(node);
019 }
020 }
021
022 public void acceptLvalue(JsExpression expression) {
023 accept(expression);
024 }
025
026 public final <T extends JsNode> void acceptWithInsertRemove(List<T> collection) {
027 for (T node : collection) {
028 accept(node);
029 }
030 }
031
032 public void visitArrayAccess(JsArrayAccess x) {
033 visitElement(x);
034 }
035
036 public void visitArray(JsArrayLiteral x) {
037 visitElement(x);
038 }
039
040 public void visitBinaryExpression(JsBinaryOperation x) {
041 visitElement(x);
042 }
043
044 public void visitBlock(JsBlock x) {
045 visitElement(x);
046 }
047
048 public void visitBoolean(JsLiteral.JsBooleanLiteral x) {
049 visitElement(x);
050 }
051
052 public void visitBreak(JsBreak x) {
053 visitElement(x);
054 }
055
056 public void visitCase(JsCase x) {
057 visitElement(x);
058 }
059
060 public void visitCatch(JsCatch x) {
061 visitElement(x);
062 }
063
064 public void visitConditional(JsConditional x) {
065 visitElement(x);
066 }
067
068 public void visitContinue(JsContinue x) {
069 visitElement(x);
070 }
071
072 public void visitDebugger(JsDebugger x) {
073 visitElement(x);
074 }
075
076 public void visitDefault(JsDefault x) {
077 visitElement(x);
078 }
079
080 public void visitDoWhile(JsDoWhile x) {
081 visitElement(x);
082 }
083
084 public void visitEmpty(JsEmpty x) {
085 visitElement(x);
086 }
087
088 public void visitExpressionStatement(JsExpressionStatement x) {
089 visitElement(x);
090 }
091
092 public void visitFor(JsFor x) {
093 visitElement(x);
094 }
095
096 public void visitForIn(JsForIn x) {
097 visitElement(x);
098 }
099
100 public void visitFunction(JsFunction x) {
101 visitElement(x);
102 }
103
104 public void visitIf(JsIf x) {
105 visitElement(x);
106 }
107
108 public void visitInvocation(JsInvocation invocation) {
109 visitElement(invocation);
110 }
111
112 public void visitLabel(JsLabel x) {
113 visitElement(x);
114 }
115
116 public void visitNameRef(JsNameRef nameRef) {
117 visitElement(nameRef);
118 }
119
120 public void visitNew(JsNew x) {
121 visitElement(x);
122 }
123
124 public void visitNull(JsNullLiteral x) {
125 visitElement(x);
126 }
127
128 public void visitInt(JsNumberLiteral.JsIntLiteral x) {
129 visitElement(x);
130 }
131
132 public void visitDouble(JsNumberLiteral.JsDoubleLiteral x) {
133 visitElement(x);
134 }
135
136 public void visitObjectLiteral(JsObjectLiteral x) {
137 visitElement(x);
138 }
139
140 public void visitParameter(JsParameter x) {
141 visitElement(x);
142 }
143
144 public void visitPostfixOperation(JsPostfixOperation x) {
145 visitElement(x);
146 }
147
148 public void visitPrefixOperation(JsPrefixOperation x) {
149 visitElement(x);
150 }
151
152 public void visitProgram(JsProgram x) {
153 visitElement(x);
154 }
155
156 public void visitProgramFragment(JsProgramFragment x) {
157 visitElement(x);
158 }
159
160 public void visitPropertyInitializer(JsPropertyInitializer x) {
161 visitElement(x);
162 }
163
164 public void visitRegExp(JsRegExp x) {
165 visitElement(x);
166 }
167
168 public void visitReturn(JsReturn x) {
169 visitElement(x);
170 }
171
172 public void visitString(JsStringLiteral x) {
173 visitElement(x);
174 }
175
176 public void visit(JsSwitch x) {
177 visitElement(x);
178 }
179
180 public void visitThis(JsLiteral.JsThisRef x) {
181 visitElement(x);
182 }
183
184 public void visitThrow(JsThrow x) {
185 visitElement(x);
186 }
187
188 public void visitTry(JsTry x) {
189 visitElement(x);
190 }
191
192 public void visit(JsVar x) {
193 visitElement(x);
194 }
195
196 public void visitVars(JsVars x) {
197 visitElement(x);
198 }
199
200 public void visitWhile(JsWhile x) {
201 visitElement(x);
202 }
203
204 public void visitDocComment(JsDocComment comment) {
205 visitElement(comment);
206 }
207
208 protected void visitElement(JsNode node) {
209 }
210 }