Package org.apache.commons.jexl3.parser
Class JexlLexicalNode
java.lang.Object
org.apache.commons.jexl3.parser.SimpleNode
org.apache.commons.jexl3.parser.JexlNode
org.apache.commons.jexl3.parser.JexlLexicalNode
- All Implemented Interfaces:
JexlParser.LexicalUnit
,Node
- Direct Known Subclasses:
ASTBlock
,ASTForeachStatement
,ASTJexlScript
Base class for AST nodes behaving as lexical units.
- Since:
- 3.2
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.commons.jexl3.parser.JexlNode
JexlNode.Constant<T>, JexlNode.Funcall, JexlNode.Info
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate LexicalScope
The local lexical scope, local information about let/const.private static final long
Fields inherited from class org.apache.commons.jexl3.parser.SimpleNode
id
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
declareSymbol
(int symbol) Declares a local symbol.int
boolean
hasSymbol
(int symbol) Checks whether a symbol is declared in this lexical unit.boolean
isConstant
(int symbol) void
jjtClose()
This method is called after all the child nodes have been added.void
setConstant
(int symbol) Methods inherited from class org.apache.commons.jexl3.parser.JexlNode
clearCache, getColumn, getLine, isConstant, isConstant, isGlobalVar, isLeftValue, isSafeLhs, isStrictOperator, jexlInfo, jjtSetFirstToken, jjtSetLastToken
Methods inherited from class org.apache.commons.jexl3.parser.SimpleNode
childrenAccept, dump, dumpOut, getId, jjtAccept, jjtAddChild, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtGetValue, jjtOpen, jjtSetChildren, jjtSetParent, jjtSetValue, toString, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
lexicalScope
The local lexical scope, local information about let/const.
-
-
Constructor Details
-
JexlLexicalNode
public JexlLexicalNode(int id) -
JexlLexicalNode
-
-
Method Details
-
declareSymbol
public boolean declareSymbol(int symbol) Description copied from interface:JexlParser.LexicalUnit
Declares a local symbol.- Specified by:
declareSymbol
in interfaceJexlParser.LexicalUnit
- Parameters:
symbol
- the symbol index in the scope- Returns:
- true if declaration was successful, false if symbol was already declared
-
isConstant
public boolean isConstant(int symbol) - Specified by:
isConstant
in interfaceJexlParser.LexicalUnit
-
setConstant
public void setConstant(int symbol) - Specified by:
setConstant
in interfaceJexlParser.LexicalUnit
-
getSymbolCount
public int getSymbolCount()- Specified by:
getSymbolCount
in interfaceJexlParser.LexicalUnit
- Returns:
- the number of local variables declared in this unit
-
hasSymbol
public boolean hasSymbol(int symbol) Description copied from interface:JexlParser.LexicalUnit
Checks whether a symbol is declared in this lexical unit.- Specified by:
hasSymbol
in interfaceJexlParser.LexicalUnit
- Parameters:
symbol
- the symbol- Returns:
- true if declared, false otherwise
-
getLexicalScope
- Specified by:
getLexicalScope
in interfaceJexlParser.LexicalUnit
- Returns:
- the set of symbols identifiers declared in this unit
-
jjtClose
public void jjtClose()Description copied from interface:Node
This method is called after all the child nodes have been added.- Specified by:
jjtClose
in interfaceNode
- Overrides:
jjtClose
in classSimpleNode
-