Class LexicalFrame
- java.lang.Object
-
- org.apache.commons.jexl3.internal.LexicalScope
-
- org.apache.commons.jexl3.internal.LexicalFrame
-
public class LexicalFrame extends LexicalScope
The set of valued symbols defined in a lexical frame.The functional scope determines the symbol identifiers. Since the frame contains values of all symbols in the functional scope, the lexical frame preserves values of symbols reused for local definition.
-
-
Field Summary
Fields Modifier and Type Field Description private FrameframeThe script frame.protected LexicalFramepreviousPrevious frame.private java.util.Deque<java.lang.Object>stackThe stack of values in the lexical frame.-
Fields inherited from class org.apache.commons.jexl3.internal.LexicalScope
BITS_PER_LONG, BITS_PER_SYMBOL, count, moreSymbols, SYMBOL_MASK, SYMBOL_SHIFT, symbols
-
-
Constructor Summary
Constructors Constructor Description LexicalFrame(Frame scriptf, LexicalFrame outerf)Lexical frame ctor.LexicalFrame(LexicalFrame src)Copy ctor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LexicalFramedefineArgs()Define the arguments.booleandefineSymbol(int symbol, boolean capture)Defines a symbol.LexicalFramepop()Pops back values and lexical frame.-
Methods inherited from class org.apache.commons.jexl3.internal.LexicalScope
addConstant, addSymbol, clearSymbols, getSymbolCount, hasSymbol, isConstant
-
-
-
-
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.[symbol identifier, value] are stacked in pairs
-
-
Constructor Detail
-
LexicalFrame
public LexicalFrame(Frame scriptf, LexicalFrame outerf)
Lexical frame ctor.- Parameters:
scriptf- the script frameouterf- 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 definecapture- whether this redefines a captured symbol- Returns:
- true if the symbol is defined, false otherwise
-
pop
public LexicalFrame pop()
Pops back values and lexical frame.- Returns:
- the previous frame
-
-