|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.camel.language.simple.BaseSimpleParser
public abstract class BaseSimpleParser
Base class for Simple language parser.
This parser is based on the principles of a recursive descent parser.
Field Summary | |
---|---|
protected boolean |
allowEscape
|
protected String |
expression
|
protected int |
index
|
protected List<SimpleNode> |
nodes
|
protected int |
previousIndex
|
protected SimpleToken |
token
|
protected List<SimpleToken> |
tokens
|
Constructor Summary | |
---|---|
protected |
BaseSimpleParser(String expression,
boolean allowEscape)
|
Method Summary | |
---|---|
protected boolean |
accept(TokenType accept)
Accept the given token. |
protected void |
clear()
Clears the parser state, which means it can be used for parsing a new input. |
protected void |
expect(TokenType expect)
Expect a given token |
protected void |
expectAndAcceptMore(TokenType expect)
Expect and accept a given number of tokens in sequence. |
protected void |
nextToken()
Advances the parser position to the next known SimpleToken
in the input. |
protected void |
nextToken(TokenType... filter)
Advances the parser position to the next known SimpleToken
in the input. |
protected void |
prepareBlocks()
Prepares blocks, such as functions, single or double quoted texts. |
protected void |
prepareUnaryExpressions()
Prepares unary expressions. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final String expression
protected final List<SimpleToken> tokens
protected final List<SimpleNode> nodes
protected SimpleToken token
protected int previousIndex
protected int index
protected boolean allowEscape
Constructor Detail |
---|
protected BaseSimpleParser(String expression, boolean allowEscape)
Method Detail |
---|
protected void nextToken()
SimpleToken
in the input.
protected void nextToken(TokenType... filter)
SimpleToken
in the input.
filter
- filter for accepted token typesprotected void clear()
protected void prepareBlocks()
Block
s in the AST. This is done
by linking child nodes
which are within the start and end of the blocks,
as child to the given block. This is done to have the AST graph updated and prepared properly.
So when the AST node is later used to create the Predicate
s
or Expression
s to be used by Camel then the AST graph
has a linked and prepared graph of nodes which represent the input expression.
protected void prepareUnaryExpressions()
Predicate
s
or Expression
s to be used by Camel then the AST graph
has a linked and prepared graph of nodes which represent the input expression.
protected boolean accept(TokenType accept)
accept
- the token
protected void expect(TokenType expect) throws SimpleParserException
expect
- the token to expect
SimpleParserException
- is thrown if the token is not as expectedprotected void expectAndAcceptMore(TokenType expect)
expect
- the token to accept
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |