|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.jexl2.parser.StringParser org.apache.commons.jexl2.parser.JexlParser
public class JexlParser
The base class for parsing, manages the parameter/local variable frame.
Field Summary | |
---|---|
protected JexlEngine.Scope |
frame
The map of named registers aka script parameters. |
Constructor Summary | |
---|---|
JexlParser()
|
Method Summary | |
---|---|
String |
checkVariable(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. |
JexlEngine.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 |
setFrame(JexlEngine.Scope theFrame)
Sets the frame to use bythis parser. |
Methods inherited from class org.apache.commons.jexl2.parser.StringParser |
---|
buildString, escapeString, readString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected JexlEngine.Scope frame
Constructor Detail |
---|
public JexlParser()
Method Detail |
---|
public void setFrame(JexlEngine.Scope theFrame)
This is used to allow parameters to be declared before parsing.
theFrame
- the register mappublic JexlEngine.Scope getFrame()
Since local variables create new named registers, it is important to regain access after parsing to known which / how-many registers are needed.
public String checkVariable(ASTIdentifier identifier, String image)
identifier
- the identifierimage
- the identifier image
public void declareVariable(ASTVar identifier, String image)
This method creates an new entry in the named register map.
identifier
- the identifier used to declareimage
- the variable namepublic void Identifier(boolean top) throws ParseException
top
- whether the identifier is beginning an l/r value
ParseException
- subclasses may throw thispublic final void Identifier() throws ParseException
ParseException
public Token getToken(int index)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |