Debian Codegraph @

src/com/google/javascript/jscomp/HotSwapCompilerPass.java

raw symbols SCIP
1 /*
2 * Copyright 2011 The Closure Compiler Authors.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 package com.google.javascript.jscomp;
18
19 import com.google.javascript.rhino.Node;
20
21 /**
22 * Interface for compiler passes that can be used in a hot-swap fashion.
23 * <p>
24 * The additional method is {@code hotSwapScript} which runs this pass on a
25 * subtree of the AST. Each pass that is intended to support hot-swap style
26 * should implement this interface.
27 * <p>
28 * It is assumed that {@code Node} argument of {@code hotSwapScript} is the root
29 * of a sub-tree in AST that represents a JS file and so is of type {@code
30 * Token.SCRIPT}.
31 *
32 * @author [email protected] (Bashir Sadjad)
33 */
34 public interface HotSwapCompilerPass extends CompilerPass {
35
36 /**
37 * Process the JS with root node root. This is supposed to be significantly
38 * faster compared to corresponding full-compiler passes.
39 *
40 * @param scriptRoot Root node corresponding to the file that is modified,
41 * should be of type {@code Token.SCRIPT}.
42 * @param originalRoot Root node corresponding to the original version of the
43 * file that is modified. Should be of type {@code token.SCRIPT}.
44 */
45 void hotSwapScript(Node scriptRoot, Node originalRoot);
46
47 }