Class ExpressionParser
- java.lang.Object
-
- com.github.zafarkhaja.semver.expr.ExpressionParser
-
- All Implemented Interfaces:
Parser<Expression>
public class ExpressionParser extends Object implements Parser<Expression>
A parser for the SemVer Expressions.- Since:
- 0.7.0
- Author:
- Zafar Khaja
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Parser<Expression>newInstance()Creates and returns new instance of theExpressionParserclass.Expressionparse(String input)Parses the SemVer Expressions.
-
-
-
Method Detail
-
newInstance
public static Parser<Expression> newInstance()
Creates and returns new instance of theExpressionParserclass. This method implements the Static Factory Method pattern.- Returns:
- a new instance of the
ExpressionParserclass
-
parse
public Expression parse(String input)
Parses the SemVer Expressions.- Specified by:
parsein interfaceParser<Expression>- Parameters:
input- a string representing the SemVer Expression- Returns:
- the AST for the SemVer Expressions
- Throws:
LexerException- when encounters an illegal characterUnexpectedTokenException- when consumes a token of an unexpected type
-
-