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
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
-
-
Field Summary
Fields Modifier and Type Field Description private LexicalScope
lexicalScope
The local lexical scope, local information about let/const.private static long
serialVersionUID
-
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 boolean
declareSymbol(int symbol)
Declares a local symbol.LexicalScope
getLexicalScope()
int
getSymbolCount()
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 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.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
-
getLexicalScope
public LexicalScope getLexicalScope()
- Specified by:
getLexicalScope
in interfaceJexlParser.LexicalUnit
- Returns:
- the set of symbols identifiers declared in this unit
-
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
-
isConstant
public boolean isConstant(int symbol)
- Specified by:
isConstant
in interfaceJexlParser.LexicalUnit
-
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
-
setConstant
public void setConstant(int symbol)
- Specified by:
setConstant
in interfaceJexlParser.LexicalUnit
-
-