JaCoP.util.fsm
Class RegularExpressionParser

java.lang.Object
  extended by JaCoP.util.fsm.RegularExpressionParser

public class RegularExpressionParser
extends java.lang.Object

Instances of this class parse the word combination little language.

Version:
3.1
Author:
Polina Makeeva and Radoslaw Szymanek

Nested Class Summary
 class RegularExpressionParser.Expression
          It creates an abstract class expression which specifies basic methods of the expression.
 class RegularExpressionParser.Literal
          It specifies a simple literal.
 class RegularExpressionParser.SyntaxException
          SyntaxException raised if not regular expression is being parsed.
 
Field Summary
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 Summary
RegularExpressionParser(java.io.StringReader input)
          It constructs a parser of the regular expression.
 
Method Summary
 RegularExpressionParser.Expression parse(boolean parseOneNext)
          This method parses an expression that it reads from a given input stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Expression

public static final int Expression
Constant denoting an expression.

See Also:
Constant Field Values

Literal

public static final int Literal
The constant denoting simple literal.

See Also:
Constant Field Values

Concatenation

public static final int Concatenation
The constant denoting concatenation expression.

See Also:
Constant Field Values

Star

public static final int Star
The constant denoting star expression.

See Also:
Constant Field Values

Sum

public static final int Sum
The constant denoting sum expression.

See Also:
Constant Field Values
Constructor Detail

RegularExpressionParser

public RegularExpressionParser(java.io.StringReader input)
                        throws RegularExpressionParser.SyntaxException
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 Detail

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