Package org.jacop.util.fsm
Class RegularExpressionParser
java.lang.Object
org.jacop.util.fsm.RegularExpressionParser
Instances of this class parse the word combination little language.
- Version:
- 4.9
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class
class
It creates an abstract class expression which specifies basic methods of the expression.class
It specifies a simple literal.(package private) class
(package private) class
static class
SyntaxException raised if not regular expression is being parsed. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The constant denoting concatenation expression.static final int
Constant denoting an expression.private LexicalAnalyzer
static final int
The constant denoting simple literal.static final int
The constant denoting star expression.static final int
The constant denoting sum expression.private int
-
Constructor Summary
ConstructorsConstructorDescriptionIt constructs a parser of the regular expression. -
Method Summary
-
Field Details
-
lexer
-
token
private int token -
Expression
public static final int ExpressionConstant denoting an expression.- See Also:
-
Literal
public static final int LiteralThe constant denoting simple literal.- See Also:
-
Concatenation
public static final int ConcatenationThe constant denoting concatenation expression.- See Also:
-
Star
public static final int StarThe constant denoting star expression.- See Also:
-
Sum
public static final int SumThe constant denoting sum expression.- See Also:
-
-
Constructor Details
-
RegularExpressionParser
It constructs a parser of the regular expression.- Parameters:
input
- string reader containing the regular expression.- Throws:
RegularExpressionParser.SyntaxException
- if first token is neither word or left parenthesis.
-
-
Method Details
-
parse
public RegularExpressionParser.Expression parse(boolean parseOneNext) throws RegularExpressionParser.SyntaxException This method parses an expression that it reads from a given input stream.- Parameters:
parseOneNext
- if parsing should parse only one item.- Returns:
- An expression that is the root of the parse tree produced by the parser.
- Throws:
RegularExpressionParser.SyntaxException
- execption rised when syntax is not followed
-
expect
Complain if the current token is not the specified kind of token.- Parameters:
t
- The type of token that is expected.- Throws:
RegularExpressionParser.SyntaxException
-
tokenName
-