public final class ExpressionParser extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ExpressionParser.SpecialItem
The enumeration describes some special items which can be met in the
expression
|
| Constructor and Description |
|---|
ExpressionParser() |
| Modifier and Type | Method and Description |
|---|---|
static ExpressionParser |
getInstance() |
ExpressionTree |
parse(String expressionStr,
PreprocessorContext context)
To parse an expression represented as a string and get a tree
|
ExpressionItem |
readExpression(PushbackReader reader,
ExpressionTree tree,
PreprocessorContext context,
boolean insideBracket,
boolean argument)
It reads an expression from a reader and fill a tree
|
public static ExpressionParser getInstance()
public ExpressionTree parse(String expressionStr, PreprocessorContext context) throws IOException
expressionStr - the expression string to be parsed, must not be nullcontext - a preprocessor context to be used to get variable values, it
can be nullIOException - it will be thrown if there is a problem to read the
expression stringpublic ExpressionItem readExpression(PushbackReader reader, ExpressionTree tree, PreprocessorContext context, boolean insideBracket, boolean argument) throws IOException
reader - the reader to be used as the character source, must not be
nulltree - the result tree to be filled by read items, must not be nullcontext - a preprocessor context to be used for variables, it can be
nullinsideBracket - the flag shows that the expression can be ended by a
bracketargument - the flag shows that the expression can be ended by a commaIOException - it will be thrown if there is a problem in reading from
the readerCopyright © 2011–2019 Igor Maznitsa. All rights reserved.