JS: converted JsVisitor to Kotlin

This commit is contained in:
Alexey Tsvetkov
2015-03-26 13:43:00 +03:00
parent cd92e2de73
commit 1f705eb77a
@@ -2,209 +2,163 @@
// for details. All rights reserved. Use of this source code is governed by a // for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file. // BSD-style license that can be found in the LICENSE file.
package com.google.dart.compiler.backend.js.ast; package com.google.dart.compiler.backend.js.ast
import com.google.dart.compiler.backend.js.ast.JsVars.JsVar; import com.google.dart.compiler.backend.js.ast.JsVars.JsVar
import java.util.List;
public abstract class JsVisitor { public abstract class JsVisitor {
public <T extends JsNode> void accept(T node) { public open fun <T : JsNode> accept(node: T) {
node.accept(this); node.accept(this)
} }
public final <T extends JsNode> void acceptList(List<T> collection) { public fun <T : JsNode> acceptList(collection: List<T>) {
for (T node : collection) { for (node in collection) {
accept(node); accept(node)
} }
} }
public void acceptLvalue(JsExpression expression) { public fun acceptLvalue(expression: JsExpression) {
accept(expression); accept(expression)
} }
public final <T extends JsNode> void acceptWithInsertRemove(List<T> collection) { public fun <T : JsNode> acceptWithInsertRemove(collection: List<T>) {
for (T node : collection) { for (node in collection) {
accept(node); accept(node)
} }
} }
public void visitArrayAccess(JsArrayAccess x) { public open fun visitArrayAccess(x: JsArrayAccess): Unit =
visitElement(x); visitElement(x)
}
public void visitArray(JsArrayLiteral x) { public open fun visitArray(x: JsArrayLiteral): Unit =
visitElement(x); visitElement(x)
}
public void visitBinaryExpression(JsBinaryOperation x) { public open fun visitBinaryExpression(x: JsBinaryOperation): Unit =
visitElement(x); visitElement(x)
}
public void visitBlock(JsBlock x) { public open fun visitBlock(x: JsBlock): Unit =
visitElement(x); visitElement(x)
}
public void visitBoolean(JsLiteral.JsBooleanLiteral x) { public open fun visitBoolean(x: JsLiteral.JsBooleanLiteral): Unit =
visitElement(x); visitElement(x)
}
public void visitBreak(JsBreak x) { public open fun visitBreak(x: JsBreak): Unit =
visitElement(x); visitElement(x)
}
public void visitCase(JsCase x) { public open fun visitCase(x: JsCase): Unit =
visitElement(x); visitElement(x)
}
public void visitCatch(JsCatch x) { public open fun visitCatch(x: JsCatch): Unit =
visitElement(x); visitElement(x)
}
public void visitConditional(JsConditional x) { public open fun visitConditional(x: JsConditional): Unit =
visitElement(x); visitElement(x)
}
public void visitContinue(JsContinue x) { public open fun visitContinue(x: JsContinue): Unit =
visitElement(x); visitElement(x)
}
public void visitDebugger(JsDebugger x) { public open fun visitDebugger(x: JsDebugger): Unit =
visitElement(x); visitElement(x)
}
public void visitDefault(JsDefault x) { public open fun visitDefault(x: JsDefault): Unit =
visitElement(x); visitElement(x)
}
public void visitDoWhile(JsDoWhile x) { public open fun visitDoWhile(x: JsDoWhile): Unit =
visitElement(x); visitElement(x)
}
public void visitEmpty(JsEmpty x) { public open fun visitEmpty(x: JsEmpty): Unit =
visitElement(x); visitElement(x)
}
public void visitExpressionStatement(JsExpressionStatement x) { public open fun visitExpressionStatement(x: JsExpressionStatement): Unit =
visitElement(x); visitElement(x)
}
public void visitFor(JsFor x) { public open fun visitFor(x: JsFor): Unit =
visitElement(x); visitElement(x)
}
public void visitForIn(JsForIn x) { public open fun visitForIn(x: JsForIn): Unit =
visitElement(x); visitElement(x)
}
public void visitFunction(JsFunction x) { public open fun visitFunction(x: JsFunction): Unit =
visitElement(x); visitElement(x)
}
public void visitIf(JsIf x) { public open fun visitIf(x: JsIf): Unit =
visitElement(x); visitElement(x)
}
public void visitInvocation(JsInvocation invocation) { public open fun visitInvocation(invocation: JsInvocation): Unit =
visitElement(invocation); visitElement(invocation)
}
public void visitLabel(JsLabel x) { public open fun visitLabel(x: JsLabel): Unit =
visitElement(x); visitElement(x)
}
public void visitNameRef(JsNameRef nameRef) { public open fun visitNameRef(nameRef: JsNameRef): Unit =
visitElement(nameRef); visitElement(nameRef)
}
public void visitNew(JsNew x) { public open fun visitNew(x: JsNew): Unit =
visitElement(x); visitElement(x)
}
public void visitNull(JsNullLiteral x) { public open fun visitNull(x: JsNullLiteral): Unit =
visitElement(x); visitElement(x)
}
public void visitInt(JsNumberLiteral.JsIntLiteral x) { public open fun visitInt(x: JsNumberLiteral.JsIntLiteral): Unit =
visitElement(x); visitElement(x)
}
public void visitDouble(JsNumberLiteral.JsDoubleLiteral x) { public open fun visitDouble(x: JsNumberLiteral.JsDoubleLiteral): Unit =
visitElement(x); visitElement(x)
}
public void visitObjectLiteral(JsObjectLiteral x) { public open fun visitObjectLiteral(x: JsObjectLiteral): Unit =
visitElement(x); visitElement(x)
}
public void visitParameter(JsParameter x) { public open fun visitParameter(x: JsParameter): Unit =
visitElement(x); visitElement(x)
}
public void visitPostfixOperation(JsPostfixOperation x) { public open fun visitPostfixOperation(x: JsPostfixOperation): Unit =
visitElement(x); visitElement(x)
}
public void visitPrefixOperation(JsPrefixOperation x) { public open fun visitPrefixOperation(x: JsPrefixOperation): Unit =
visitElement(x); visitElement(x)
}
public void visitProgram(JsProgram x) { public open fun visitProgram(x: JsProgram): Unit =
visitElement(x); visitElement(x)
}
public void visitProgramFragment(JsProgramFragment x) { public open fun visitProgramFragment(x: JsProgramFragment): Unit =
visitElement(x); visitElement(x)
}
public void visitPropertyInitializer(JsPropertyInitializer x) { public open fun visitPropertyInitializer(x: JsPropertyInitializer): Unit =
visitElement(x); visitElement(x)
}
public void visitRegExp(JsRegExp x) { public open fun visitRegExp(x: JsRegExp): Unit =
visitElement(x); visitElement(x)
}
public void visitReturn(JsReturn x) { public open fun visitReturn(x: JsReturn): Unit =
visitElement(x); visitElement(x)
}
public void visitString(JsStringLiteral x) { public open fun visitString(x: JsStringLiteral): Unit =
visitElement(x); visitElement(x)
}
public void visit(JsSwitch x) { public open fun visit(x: JsSwitch): Unit =
visitElement(x); visitElement(x)
}
public void visitThis(JsLiteral.JsThisRef x) { public open fun visitThis(x: JsLiteral.JsThisRef): Unit =
visitElement(x); visitElement(x)
}
public void visitThrow(JsThrow x) { public open fun visitThrow(x: JsThrow): Unit =
visitElement(x); visitElement(x)
}
public void visitTry(JsTry x) { public open fun visitTry(x: JsTry): Unit =
visitElement(x); visitElement(x)
}
public void visit(JsVar x) { public open fun visit(x: JsVar): Unit =
visitElement(x); visitElement(x)
}
public void visitVars(JsVars x) { public open fun visitVars(x: JsVars): Unit =
visitElement(x); visitElement(x)
}
public void visitWhile(JsWhile x) { public open fun visitWhile(x: JsWhile): Unit =
visitElement(x); visitElement(x)
}
public void visitDocComment(JsDocComment comment) { public open fun visitDocComment(comment: JsDocComment): Unit =
visitElement(comment); visitElement(comment)
}
protected void visitElement(JsNode node) { protected open fun visitElement(node: JsNode) {
} }
} }