Class DFATest

java.lang.Object
  extended by DFATest

public final class DFATest
  extends Object

Tests for the DFA class using JUnit.

Version:
CSTheory (4)
Author:
Dr. Jody Paul


Constructor Summary
DFATest()
           
 
Method Summary
 void assignmentStatementDFATest()
          Construct and test a simple assignment statement checker.
 void astar_bDFATest()
          Constructs and tests a string validator for regular expression a*b.
 void astar_c_abstar_c_cstarDFATest()
          Construct and test a string validator for regular expression a*c(ab)*cc*.
 void astarDFATest()
          Constructs and tests a string validator for regular expression a* over the alphabet {a, b}.
static boolean regexMatch(String regexp, String input)
          Determines if java.util.regex identifies the entire input string as matching the given regular expression.
 void utilregexTests()
          Tests using java.util.regex for comparison.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DFATest

public DFATest()
Method Detail

assignmentStatementDFATest

public void assignmentStatementDFATest()
Construct and test a simple assignment statement checker. All variables are a single lower-case letter. Expression operators are +, -, *, and /. Assignment operator is =. Blanks are not in the alphabet. The assignment statement must end with ; (a semicolon).


astar_bDFATest

public void astar_bDFATest()
Constructs and tests a string validator for regular expression a*b. Includes tests of state activity counter.


astar_c_abstar_c_cstarDFATest

public void astar_c_abstar_c_cstarDFATest()
Construct and test a string validator for regular expression a*c(ab)*cc*.


astarDFATest

public void astarDFATest()
Constructs and tests a string validator for regular expression a* over the alphabet {a, b}.


regexMatch

public static boolean regexMatch(String regexp,
                                 String input)
Determines if java.util.regex identifies the entire input string as matching the given regular expression.

Parameters:
regexp - the regular expression
input - the input string
Returns:
true if the entire input string is matched by the pattern; false otherwise

utilregexTests

public void utilregexTests()
Tests using java.util.regex for comparison. The RE [a-z][0-9]+ represents identifiers that start with a single lower-case letter which is then followed by one or more numerals (e.g., a0 and d4298 but not ab1 or 0a).