Interface LexicalContextNode

All Known Subinterfaces:
BreakableNode, LexicalContextScope
All Known Implementing Classes:
Block, ClassNode, ForNode, FunctionNode, LabelNode, LiteralNode.ArrayLiteralNode, LoopNode, SwitchNode, WhileNode, WithNode

public interface LexicalContextNode
Interface for nodes that can be part of the lexical context.
See Also:
  • Method Details

    • accept

      Node accept(LexicalContext lc, NodeVisitor<? extends LexicalContext> visitor)
      Accept function for the node given a lexical context. It must be prepared to replace itself if present in the lexical context
      Parameters:
      lc - lexical context
      visitor - node visitor
      Returns:
      new node or same node depending on state change
    • accept

      <R> R accept(LexicalContext lc, TranslatorNodeVisitor<? extends LexicalContext, R> visitor)
    • accept

      default Node accept(NodeVisitor<? extends LexicalContext> visitor)
      Helper method for accept for items of this lexical context, delegates to the subclass accept and makes sure that the node is on the context before accepting and gets popped after accepting (and that the stack is consistent in that the node has been replaced with the possible new node resulting in visitation)
    • accept

      default <R> R accept(TranslatorNodeVisitor<? extends LexicalContext, R> visitor)