Class LexicalFrame


  • public class LexicalFrame
    extends LexicalScope
    The set of valued symbols defined in a lexical frame.

    The symbol identifiers are determined by the functional scope.

    • Field Detail

      • frame

        private final Frame frame
        The script frame.
      • previous

        protected final LexicalFrame previous
        Previous frame.
      • stack

        private java.util.Deque<java.lang.Object> stack
        The stack of values in the lexical frame.
    • Constructor Detail

      • LexicalFrame

        public LexicalFrame​(Frame scriptf,
                            LexicalFrame outerf)
        Lexical frame ctor.
        Parameters:
        scriptf - the script frame
        outerf - the previous lexical frame
      • LexicalFrame

        public LexicalFrame​(LexicalFrame src)
        Copy ctor.
        Parameters:
        src - the frame to copy
    • Method Detail

      • defineArgs

        public LexicalFrame defineArgs()
        Define the arguments.
        Returns:
        this frame
      • defineSymbol

        public boolean defineSymbol​(int symbol,
                                    boolean capture)
        Defines a symbol.
        Parameters:
        symbol - the symbol to define
        capture - whether this redefines a captured symbol
        Returns:
        true if symbol is defined, false otherwise
      • pop

        public LexicalFrame pop()
        Pops back values and lexical frame.
        Returns:
        the previous frame