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:
JexlCache.Reference,JexlParser.LexicalUnit,Node
- Direct Known Subclasses:
ASTArrayAccess,ASTBlock,ASTForeachStatement,ASTJexlScript,ASTTryResources,ASTTryStatement
public abstract class JexlLexicalNode extends JexlNode implements JexlParser.LexicalUnit
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, JexlNode.JxltHandle
-
-
Field Summary
Fields Modifier and Type Field Description private LexicalScopelexicalScopeThe local lexical scope, local information about let/const.private static longserialVersionUID-
Fields inherited from class org.apache.commons.jexl3.parser.SimpleNode
id
-
-
Constructor Summary
Constructors Constructor Description JexlLexicalNode(int id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandeclareSymbol(int symbol)Declares a local symbol.LexicalScopegetLexicalScope()intgetSymbolCount()booleanhasSymbol(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, getCache, getColumn, getLine, isConstant, isConstant, isGlobalVar, isLeftValue, isSafeLhs, isStrictOperator, jexlInfo, jexlInfo, jjtSetFirstToken, jjtSetLastToken, setCache
-
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 Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
lexicalScope
private LexicalScope lexicalScope
The local lexical scope, local information about let/const.
-
-
Method Detail
-
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
public LexicalScope 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
-
-