Class JexlParser
java.lang.Object
edu.internet2.middleware.grouperClientExt.org.apache.commons.jexl2.parser.StringParser
edu.internet2.middleware.grouperClientExt.org.apache.commons.jexl2.parser.JexlParser
- Direct Known Subclasses:
Parser
The base class for parsing, manages the parameter/local variable frame.
-
Field Summary
Modifier and TypeFieldDescriptionprotected JexlEngine.Scope
The map of named registers aka script parameters. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncheckVariable
(ASTIdentifier identifier, String image) Checks whether an identifier is a local variable or argument, ie stored in a register.void
declareVariable
(ASTVar identifier, String image) Declares a local variable.getFrame()
Gets the frame used by this parser.getToken
(int index) final void
void
Identifier
(boolean top) Default implementation does nothing but is overriden by generated code.void
setFrame
(JexlEngine.Scope theFrame) Sets the frame to use bythis parser.Methods inherited from class edu.internet2.middleware.grouperClientExt.org.apache.commons.jexl2.parser.StringParser
buildString, escapeString, readString
-
Field Details
-
frame
The map of named registers aka script parameters. Each parameter is associated to a register and is materialized as an offset in the registers array used during evaluation.
-
-
Constructor Details
-
JexlParser
public JexlParser()
-
-
Method Details
-
setFrame
Sets the frame to use bythis parser.This is used to allow parameters to be declared before parsing.
- Parameters:
theFrame
- the register map
-
getFrame
Gets the frame used by this parser.Since local variables create new named registers, it is important to regain access after parsing to known which / how-many registers are needed.
- Returns:
- the named register map
-
checkVariable
Checks whether an identifier is a local variable or argument, ie stored in a register.- Parameters:
identifier
- the identifierimage
- the identifier image- Returns:
- the image
-
declareVariable
Declares a local variable.This method creates an new entry in the named register map.
- Parameters:
identifier
- the identifier used to declareimage
- the variable name
-
Identifier
Default implementation does nothing but is overriden by generated code.- Parameters:
top
- whether the identifier is beginning an l/r value- Throws:
ParseException
- subclasses may throw this
-
Identifier
- Throws:
ParseException
-
getToken
-