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.10
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) classclassIt creates an abstract class expression which specifies basic methods of the expression.classIt specifies a simple literal.(package private) class(package private) classstatic classSyntaxException raised if not regular expression is being parsed. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe constant denoting concatenation expression.static final intConstant denoting an expression.private LexicalAnalyzerstatic final intThe constant denoting simple literal.static final intThe constant denoting star expression.static final intThe 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
-