public class RegularExpressionParser extends Object
Modifier and Type | Class and Description |
---|---|
class |
RegularExpressionParser.Expression
It creates an abstract class expression which specifies basic methods of
the expression.
|
class |
RegularExpressionParser.Literal
It specifies a simple literal.
|
static class |
RegularExpressionParser.SyntaxException
SyntaxException raised if not regular expression is being parsed.
|
Modifier and Type | Field and Description |
---|---|
static int |
Concatenation
The constant denoting concatenation expression.
|
static int |
Expression
Constant denoting an expression.
|
static int |
Literal
The constant denoting simple literal.
|
static int |
Star
The constant denoting star expression.
|
static int |
Sum
The constant denoting sum expression.
|
Constructor and Description |
---|
RegularExpressionParser(StringReader input)
It constructs a parser of the regular expression.
|
Modifier and Type | Method and Description |
---|---|
RegularExpressionParser.Expression |
parse(boolean parseOneNext)
This method parses an expression that it reads from a given input stream.
|
public static final int Expression
public static final int Literal
public static final int Concatenation
public static final int Star
public static final int Sum
public RegularExpressionParser(StringReader input) throws RegularExpressionParser.SyntaxException
input
- string reader containing the regular expression.RegularExpressionParser.SyntaxException
- if first token is neither word or left parenthesis.public RegularExpressionParser.Expression parse(boolean parseOneNext) throws RegularExpressionParser.SyntaxException
parseOneNext
- if parsing should parse only one item.RegularExpressionParser.SyntaxException
- execption rised when syntax is not followedCopyright © 2022. All rights reserved.