Package org.allspice.util

Examples of org.allspice.util.State


      t = t.getTransition(c) ;
    }
    return false ;
  }
  public void test0() {
    State state = StateMachine.makeState("a", false) ;
    assertTrue(accepts(state,"a")) ;
    assertFalse(accepts(state,"b")) ;
    assertFalse(accepts(state,"aa")) ;
  }
View Full Code Here


    assertTrue(accepts(state,"a")) ;
    assertFalse(accepts(state,"b")) ;
    assertFalse(accepts(state,"aa")) ;
  }
  public void test1() {
    State s = StateMachine.makeState("a", false) ;
    State t = StateMachine.makeState("b", false) ;
    State state = StateMachine.union(s,t) ;
    assertTrue(accepts(state,"a")) ;
    assertTrue(accepts(state,"b")) ;
    assertFalse(accepts(state,"aa")) ;
    assertFalse(accepts(state,"ab")) ;
  }
View Full Code Here

    assertTrue(accepts(state,"b")) ;
    assertFalse(accepts(state,"aa")) ;
    assertFalse(accepts(state,"ab")) ;
  }
  public void test2() {
    State s = StateMachine.makeState("a", false) ;
    State t = StateMachine.makeState("b", false) ;
    State state = StateMachine.concat(s,t) ;
    assertFalse(accepts(state,"a")) ;
    assertFalse(accepts(s,"b")) ;
    assertFalse(accepts(state,"b")) ;
    assertFalse(accepts(state,"c")) ;
    assertTrue(accepts(state,"ab")) ;
View Full Code Here

    assertTrue(accepts(state,"ab")) ;
    assertFalse(accepts(state,"aba")) ;
    assertFalse(accepts(state,"abb")) ;
  }
  public void test3() {
    State s = StateMachine.makeState("a", false) ;
    State state = StateMachine.closure(s) ;
    assertFalse(accepts(state,"")) ;
    assertFalse(accepts(state,"c")) ;
    assertTrue(accepts(state,"a")) ;
    assertTrue(accepts(state,"aa")) ;
    assertTrue(accepts(state,"aaaaaaaaaaa")) ;
View Full Code Here

    assertTrue(accepts(state,"a")) ;
    assertTrue(accepts(state,"aa")) ;
    assertTrue(accepts(state,"aaaaaaaaaaa")) ;
  }
  public void test4() {
    State s = StateMachine.makeState("a", false) ;
    State t = StateMachine.makeState("b", false) ;
    State st = StateMachine.union(s,t) ;
    State state = StateMachine.closure(st) ;
    assertFalse(accepts(state,"")) ;
    assertTrue(accepts(state,"a")) ;
    assertTrue(accepts(state,"b")) ;
    assertFalse(accepts(state,"c")) ;
    assertTrue(accepts(state,"aa")) ;
View Full Code Here

    assertTrue(accepts(state,"aaaaaaaaaaa")) ;
    assertTrue(accepts(state,"bbbbbbbbb")) ;
    assertTrue(accepts(state,"aaabbbabbaaa")) ;
  }
  public void test5() {
    State s = StateMachine.makeState("aa", false) ;
    State t = StateMachine.makeState("bbb", false) ;
    State st = StateMachine.union(s,t) ;
    State state = StateMachine.closure(st) ;
    assertFalse(accepts(state,"")) ;
    assertFalse(accepts(state,"a")) ;
    assertTrue(accepts(state,"aa")) ;
    assertTrue(accepts(state,"bbb")) ;
    assertFalse(accepts(state,"bbbb")) ;
View Full Code Here

    assertTrue(accepts(state,"aaaaaaaa")) ;
    assertTrue(accepts(state,"bbbbbbbbbbbb")) ;
    assertTrue(accepts(state,"aabbbaaaabbbbbbaa")) ;
  }
  public void test6() {
    State state = StateMachine.makeState("", false) ;
    assertTrue(accepts(state,"")) ;
    assertFalse(accepts(state,"a")) ;
  }
View Full Code Here

    State state = StateMachine.makeState("", false) ;
    assertTrue(accepts(state,"")) ;
    assertFalse(accepts(state,"a")) ;
  }
  public void test7() {
    State state = StateMachine.not(StateMachine.makeState("a", false)) ;
    assertFalse(accepts(state,"a")) ;
    assertTrue(accepts(state,"b")) ;
    assertTrue(accepts(state,"aa")) ;
    assertTrue(accepts(state,"abaaba")) ;
    assertTrue(accepts(state,"")) ;
View Full Code Here

    assertTrue(accepts(state,"aa")) ;
    assertTrue(accepts(state,"abaaba")) ;
    assertTrue(accepts(state,"")) ;
  }
  public void test8() {
    State state = StateMachine.intersection(StateMachine.makeState("a", false)) ;
    assertTrue(accepts(state,"a")) ;
  }
View Full Code Here

  public void test8() {
    State state = StateMachine.intersection(StateMachine.makeState("a", false)) ;
    assertTrue(accepts(state,"a")) ;
  }
  public void test9() {
    State state = StateMachine.intersection(StateMachine.charClass("abcdef", false,false),StateMachine.charClass("defghi", false,false)) ;
    assertFalse(accepts(state,"a")) ;
    assertFalse(accepts(state,"b")) ;
    assertFalse(accepts(state,"c")) ;
    assertTrue(accepts(state,"d")) ;
    assertTrue(accepts(state,"e")) ;
View Full Code Here

TOP

Related Classes of org.allspice.util.State

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.