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:
ASTArrayAccess,ASTBlock,ASTForeachStatement,ASTJexlScript,ASTTryResources
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 LexicalScopeThe local lexical scope, local information about let/const.private static final longFields inherited from class org.apache.commons.jexl3.parser.SimpleNode
id -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleandeclareSymbol(int symbol) Declares a local symbol.intbooleanhasSymbol(int symbol) Checks whether a symbol is declared in this lexical unit.booleanisConstant(int symbol) voidjjtClose()This method is called after all the child nodes have been added.voidsetConstant(int symbol) Methods inherited from class org.apache.commons.jexl3.parser.JexlNode
clearCache, getColumn, getLine, isConstant, isConstant, isGlobalVar, isLeftValue, isSafeLhs, isStrictOperator, jexlInfo, jjtSetFirstToken, jjtSetLastTokenMethods 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)
-
-
Method Details
-
declareSymbol
public boolean declareSymbol(int symbol) Description copied from interface:JexlParser.LexicalUnitDeclares a local symbol.- Specified by:
declareSymbolin interfaceJexlParser.LexicalUnit- Parameters:
symbol- the symbol index in the scope- Returns:
- true if declaration was successful, false if symbol was already declared
-
getLexicalScope
- Specified by:
getLexicalScopein interfaceJexlParser.LexicalUnit- Returns:
- the set of symbols identifiers declared in this unit
-
getSymbolCount
public int getSymbolCount()- Specified by:
getSymbolCountin interfaceJexlParser.LexicalUnit- Returns:
- the number of local variables declared in this unit
-
hasSymbol
public boolean hasSymbol(int symbol) Description copied from interface:JexlParser.LexicalUnitChecks whether a symbol is declared in this lexical unit.- Specified by:
hasSymbolin interfaceJexlParser.LexicalUnit- Parameters:
symbol- the symbol- Returns:
- true if declared, false otherwise
-
isConstant
public boolean isConstant(int symbol) - Specified by:
isConstantin interfaceJexlParser.LexicalUnit
-
jjtClose
public void jjtClose()Description copied from interface:NodeThis method is called after all the child nodes have been added.- Specified by:
jjtClosein interfaceNode- Overrides:
jjtClosein classSimpleNode
-
setConstant
public void setConstant(int symbol) - Specified by:
setConstantin interfaceJexlParser.LexicalUnit
-