Class ValueReader
java.lang.Object
ch.andre601.expressionparser.parsers.ValueReader
- Direct Known Subclasses:
BooleanConstantReader
,NegatedExpressionReader
,NegatedNumberReader
,NumberConstantReader
,ParenthesisedExpressionReader
,StringConstantReader
Abstract class used in other classes to create a ValueReader.
The Value reader goes through the collection of
The Value reader goes through the collection of
Tokens
and tries to convert them into a
ExpressionTemplate
should the token match a specific one.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract ExpressionTemplate
read
(ExpressionTemplateParser parser, List<Token> tokens, ParseWarnCollector collector) Method called by theExpressionTemplateParser
to convert a List ofToken
into a singleExpressionTemplate
.
-
Constructor Details
-
ValueReader
public ValueReader()
-
-
Method Details
-
read
public abstract ExpressionTemplate read(ExpressionTemplateParser parser, List<Token> tokens, ParseWarnCollector collector) Method called by theExpressionTemplateParser
to convert a List ofToken
into a singleExpressionTemplate
.- Parameters:
parser
- ExpressionTemplateParser instance to use. The default ExpressionTemplateParser provides itself here.tokens
- List of tokens to parse into an ExpressionTemplate.collector
-ParseWarnCollector
instance to use.- Returns:
- Possibly-null ExpressionTemplate.
-