public abstract class JexlParser extends StringParser
| Constructor and Description |
|---|
JexlParser() |
| Modifier and Type | Method and Description |
|---|---|
void |
allowRegisters(boolean registers)
Internal, for debug purpose only.
|
String |
checkVariable(ASTIdentifier identifier,
String image)
Checks whether an identifier is a local variable or argument, ie a symbol, stored in a register.
|
void |
declareParameter(String identifier)
Declares a local parameter.
|
void |
declarePragma(String key,
Object value)
Adds a pragma declaration.
|
void |
declareVariable(ASTVar identifier,
String image)
Declares a local variable.
|
Scope |
getFrame()
Gets the frame used by this parser.
|
Token |
getToken(int index) |
void |
Identifier() |
void |
Identifier(boolean top)
Default implementation does nothing but is overriden by generated code.
|
void |
popFrame()
Pops back to previous local variable frame.
|
void |
pushFrame()
Create a new local variable frame and push it as current scope.
|
void |
setFrame(Scope theFrame)
Sets the frame to use by this parser.
|
protected void |
throwParsingException(JexlNode node)
Throws a parsing exception.
|
buildString, escapeString, readStringpublic void allowRegisters(boolean registers)
public void setFrame(Scope theFrame)
This is used to allow parameters to be declared before parsing.
theFrame - the register mappublic Scope getFrame()
Since local variables create new symbols, it is important to regain access after parsing to known which / how-many registers are needed.
public void pushFrame()
public void popFrame()
public String checkVariable(ASTIdentifier identifier, String image)
identifier - the identifierimage - the identifier imagepublic void declareVariable(ASTVar identifier, String image)
This method creates an new entry in the symbol map.
identifier - the identifier used to declareimage - the variable namepublic void declarePragma(String key, Object value)
key - the pragma keyvalue - the pragma valuepublic void declareParameter(String identifier)
This method creates an new entry in the symbol map.
identifier - the parameter namepublic void Identifier(boolean top)
throws ParseException
top - whether the identifier is beginning an l/r valueParseException - subclasses may throw thispublic final void Identifier()
throws ParseException
ParseExceptionpublic Token getToken(int index)
protected void throwParsingException(JexlNode node)
node - the node that caused itCopyright © 2001–2016 The Apache Software Foundation. All rights reserved.