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 org.jetbrains.annotations.Nullable;
008    
009    /**
010     * The context in which a JsNode visitation occurs. This represents the set of
011     * possible operations a JsVisitor subclass can perform on the currently visited
012     * node.
013     */
014    public interface JsContext {
015      boolean canInsert();
016    
017      boolean canRemove();
018    
019      void insertAfter(JsNode node);
020    
021      void insertBefore(JsNode node);
022    
023      boolean isLvalue();
024    
025      void removeMe();
026    
027      void replaceMe(JsNode node);
028    
029      @Nullable
030      JsNode getCurrentNode();
031    }