|
||||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
java.lang.Objectorg.activiti.engine.impl.juel.Parser
public class Parser
Handcrafted top-down parser.
嵌套类摘要 | |
---|---|
static class |
Parser.ExtensionHandler
Provide limited support for syntax extensions. |
static class |
Parser.ExtensionPoint
|
static class |
Parser.ParseException
Parse exception type |
字段摘要 | |
---|---|
protected Builder |
context
|
protected Map<Scanner.ExtensionToken,Parser.ExtensionHandler> |
extensions
|
protected Scanner |
scanner
|
构造方法摘要 | |
---|---|
Parser(Builder context,
String input)
|
方法摘要 | |
---|---|
protected AstNode |
add(boolean required)
add := add (<PLUS> mul | <MINUS> mul)* |
protected AstNode |
and(boolean required)
and := eq (<AND> eq)* |
protected AstNode |
cmp(boolean required)
cmp := add (<LT> add | <LE> add | <GE> add | <GT> add)* |
protected Scanner.Token |
consumeToken()
consume current token (get next token). |
protected Scanner.Token |
consumeToken(Scanner.Symbol expected)
consume current token (get next token); throw exception if the current token doesn't match the expected symbol. |
protected AstBinary |
createAstBinary(AstNode left,
AstNode right,
AstBinary.Operator operator)
|
protected AstBracket |
createAstBracket(AstNode base,
AstNode property,
boolean lvalue,
boolean strict)
|
protected AstChoice |
createAstChoice(AstNode question,
AstNode yes,
AstNode no)
|
protected AstComposite |
createAstComposite(List<AstNode> nodes)
|
protected AstDot |
createAstDot(AstNode base,
String property,
boolean lvalue)
|
protected AstFunction |
createAstFunction(String name,
int index,
AstParameters params)
|
protected AstIdentifier |
createAstIdentifier(String name,
int index)
|
protected AstMethod |
createAstMethod(AstProperty property,
AstParameters params)
|
protected AstUnary |
createAstUnary(AstNode child,
AstUnary.Operator operator)
|
protected Scanner |
createScanner(String expression)
|
protected AstNode |
eq(boolean required)
eq := cmp (<EQ> cmp | <NE> cmp)* |
protected AstEval |
eval()
eval := dynamic | deferred |
protected AstEval |
eval(boolean required,
boolean deferred)
dynmamic := <START_EVAL_DYNAMIC> expr <END_EVAL> deferred := <START_EVAL_DEFERRED> expr <END_EVAL> |
protected AstNode |
expr(boolean required)
expr := or (<QUESTION> expr <COLON> expr)? |
protected void |
fail(Scanner.Symbol expected)
throw exception |
protected void |
fail(String expected)
throw exception |
protected AstFunction |
function(String name,
AstParameters params)
|
protected Parser.ExtensionHandler |
getExtensionHandler(Scanner.Token token)
|
protected List<FunctionNode> |
getFunctions()
|
protected List<IdentifierNode> |
getIdentifiers()
|
protected Scanner.Token |
getToken()
|
protected AstIdentifier |
identifier(String name)
|
protected AstNode |
literal()
literal := <TRUE> | <FALSE> | <STRING> | <INTEGER> | <FLOAT> | <NULL> |
protected Scanner.Token |
lookahead(int index)
get lookahead symbol. |
protected AstNode |
mul(boolean required)
mul := unary (<MUL> unary | <DIV> unary | <MOD> unary)* |
protected AstNode |
nonliteral()
nonliteral := <IDENTIFIER> | function | <LPAREN> expr <RPAREN> function := (<IDENTIFIER> <COLON>)? |
protected AstNode |
or(boolean required)
or := and (<OR> and)* |
protected AstParameters |
params()
params := <LPAREN> (expr (<COMMA> expr)*)? |
protected Number |
parseFloat(String string)
Parse a floating point literal. |
protected Number |
parseInteger(String string)
Parse an integer literal. |
void |
putExtensionHandler(Scanner.ExtensionToken token,
Parser.ExtensionHandler extension)
|
protected AstNode |
text()
text := <TEXT> |
Tree |
tree()
tree := text? |
protected AstNode |
unary(boolean required)
unary := <NOT> unary | <MINUS> unary | <EMPTY> unary | value |
protected AstNode |
value()
value := (nonliteral | literal) (<DOT> <IDENTIFIER> | <LBRACK> expr <RBRACK>)* |
从类 java.lang.Object 继承的方法 |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
字段详细信息 |
---|
protected final Builder context
protected final Scanner scanner
protected Map<Scanner.ExtensionToken,Parser.ExtensionHandler> extensions
构造方法详细信息 |
---|
public Parser(Builder context, String input)
方法详细信息 |
---|
protected Scanner createScanner(String expression)
public void putExtensionHandler(Scanner.ExtensionToken token, Parser.ExtensionHandler extension)
protected Parser.ExtensionHandler getExtensionHandler(Scanner.Token token)
protected Number parseInteger(String string) throws Parser.ParseException
string
- string to parse
Long.valueOf(string)
Parser.ParseException
protected Number parseFloat(String string) throws Parser.ParseException
string
- string to parse
Double.valueOf(string)
Parser.ParseException
protected AstBinary createAstBinary(AstNode left, AstNode right, AstBinary.Operator operator)
protected AstBracket createAstBracket(AstNode base, AstNode property, boolean lvalue, boolean strict)
protected AstChoice createAstChoice(AstNode question, AstNode yes, AstNode no)
protected AstComposite createAstComposite(List<AstNode> nodes)
protected AstDot createAstDot(AstNode base, String property, boolean lvalue)
protected AstFunction createAstFunction(String name, int index, AstParameters params)
protected AstIdentifier createAstIdentifier(String name, int index)
protected AstMethod createAstMethod(AstProperty property, AstParameters params)
protected AstUnary createAstUnary(AstNode child, AstUnary.Operator operator)
protected final List<FunctionNode> getFunctions()
protected final List<IdentifierNode> getIdentifiers()
protected final Scanner.Token getToken()
protected void fail(String expected) throws Parser.ParseException
Parser.ParseException
protected void fail(Scanner.Symbol expected) throws Parser.ParseException
Parser.ParseException
protected final Scanner.Token lookahead(int index) throws Scanner.ScanException, Parser.ParseException
Scanner.ScanException
Parser.ParseException
protected final Scanner.Token consumeToken() throws Scanner.ScanException, Parser.ParseException
Scanner.ScanException
Parser.ParseException
protected final Scanner.Token consumeToken(Scanner.Symbol expected) throws Scanner.ScanException, Parser.ParseException
Scanner.ScanException
Parser.ParseException
public Tree tree() throws Scanner.ScanException, Parser.ParseException
Scanner.ScanException
Parser.ParseException
protected AstNode text() throws Scanner.ScanException, Parser.ParseException
Scanner.ScanException
Parser.ParseException
protected AstEval eval() throws Scanner.ScanException, Parser.ParseException
Scanner.ScanException
Parser.ParseException
protected AstEval eval(boolean required, boolean deferred) throws Scanner.ScanException, Parser.ParseException
Scanner.ScanException
Parser.ParseException
protected AstNode expr(boolean required) throws Scanner.ScanException, Parser.ParseException
Scanner.ScanException
Parser.ParseException
protected AstNode or(boolean required) throws Scanner.ScanException, Parser.ParseException
Scanner.ScanException
Parser.ParseException
protected AstNode and(boolean required) throws Scanner.ScanException, Parser.ParseException
Scanner.ScanException
Parser.ParseException
protected AstNode eq(boolean required) throws Scanner.ScanException, Parser.ParseException
Scanner.ScanException
Parser.ParseException
protected AstNode cmp(boolean required) throws Scanner.ScanException, Parser.ParseException
Scanner.ScanException
Parser.ParseException
protected AstNode add(boolean required) throws Scanner.ScanException, Parser.ParseException
Scanner.ScanException
Parser.ParseException
protected AstNode mul(boolean required) throws Scanner.ScanException, Parser.ParseException
Scanner.ScanException
Parser.ParseException
protected AstNode unary(boolean required) throws Scanner.ScanException, Parser.ParseException
Scanner.ScanException
Parser.ParseException
protected AstNode value() throws Scanner.ScanException, Parser.ParseException
Scanner.ScanException
Parser.ParseException
protected AstNode nonliteral() throws Scanner.ScanException, Parser.ParseException
Scanner.ScanException
Parser.ParseException
protected AstParameters params() throws Scanner.ScanException, Parser.ParseException
Scanner.ScanException
Parser.ParseException
protected AstNode literal() throws Scanner.ScanException, Parser.ParseException
Scanner.ScanException
Parser.ParseException
protected final AstFunction function(String name, AstParameters params)
protected final AstIdentifier identifier(String name)
|
||||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |