|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.jexl3.parser.StringParser
org.apache.commons.jexl3.parser.JexlParser
public abstract class JexlParser
The base class for parsing, manages the parameter/local variable frame.
| Constructor Summary | |
|---|---|
JexlParser()
|
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class org.apache.commons.jexl3.parser.StringParser |
|---|
buildString, escapeString, readString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JexlParser()
| Method Detail |
|---|
public 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 image
public void declareVariable(ASTVar identifier,
String image)
This method creates an new entry in the symbol map.
identifier - the identifier used to declareimage - the variable name
public 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 name
public void Identifier(boolean top)
throws ParseException
top - whether the identifier is beginning an l/r value
ParseException - subclasses may throw this
public final void Identifier()
throws ParseException
ParseExceptionpublic Token getToken(int index)
protected void throwParsingException(JexlNode node)
node - the node that caused it
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||