Package pl.edu.amu.wmi.daut.base

Examples of pl.edu.amu.wmi.daut.base.NaiveAutomatonSpecification$NaiveTransition


public class NewLineOperator extends NullaryRegexpOperator {

    @Override
    public AutomatonSpecification createFixedAutomaton() {
        return new NaiveAutomatonSpecification().makeOneTransitionAutomaton('\n');
    }
View Full Code Here


    private String s;

    @Override
    public AutomatonSpecification createFixedAutomaton() {
      AutomatonSpecification automaton = new NaiveAutomatonSpecification();
      automaton.markAsInitial(automaton.addState());
      automaton.markAsFinal(automaton.addTransitionSequence(automaton.getInitialState(), this.s));
      return automaton;
    }
View Full Code Here

    @Override
    public AutomatonSpecification createFixedAutomaton() {

        int intValue = Integer.parseInt(Integer.toString(octValue), BASE);

        return new NaiveAutomatonSpecification()
                .makeOneTransitionAutomaton((char) intValue);
    }
View Full Code Here

* Odpowiada to wyrażeniu regularnego '.*'.
*/
public class AnyStringOperator extends NullaryRegexpOperator {
    @Override
    public final AutomatonSpecification createFixedAutomaton() {
        NaiveAutomatonSpecification spec = new NaiveAutomatonSpecification();

        State q = spec.addState();
        spec.markAsInitial(q);
        spec.markAsFinal(q);

        spec.addTransition(q, q, new AnyTransitionLabel());

        return spec;
    }
View Full Code Here

    /**
     * Automat z jednym przejściem na dwóch stanach.
     */
    public final void testTwoStatesOneTransitionLabel() {

        AutomatonSpecification automaton = new NaiveAutomatonSpecification();

        State q0 = automaton.addState();
        State q1 = automaton.addState();
        automaton.addTransition(q0, q1, new CharTransitionLabel('a'));

        automaton.markAsInitial(q0);
        automaton.markAsFinal(q1);

        MinimumNumberOfOccurencesOperator oper =
                new MinimumNumberOfOccurencesOperator(3);

        NondeterministicAutomatonByThompsonApproach result =
View Full Code Here

    /**
     * Automat akceptuje słowa a(b^n)a.
     */
    public final void testExemplaryAutomaton() {

        AutomatonSpecification automaton = new NaiveAutomatonSpecification();

        State q0 = automaton.addState();
        State q1 = automaton.addState();
        State q2 = automaton.addState();
        automaton.addTransition(q0, q1, new CharTransitionLabel('a'));
        automaton.addTransition(q1, q2, new CharTransitionLabel('a'));
        automaton.addLoop(q1, new CharTransitionLabel('b'));


        automaton.markAsInitial(q0);
        automaton.markAsFinal(q2);

        MinimumNumberOfOccurencesOperator oper =
                new MinimumNumberOfOccurencesOperator(2);

        NondeterministicAutomatonByThompsonApproach result =
View Full Code Here

    /**
     * Pusty automat.
     */
    public final void testEmptyAutomaton() {

        AutomatonSpecification automaton = new NaiveAutomatonSpecification();

        MinimumNumberOfOccurencesOperator oper =
            new MinimumNumberOfOccurencesOperator(10);

        NondeterministicAutomatonByThompsonApproach result =
View Full Code Here

     * Stany te są stanami akceptującymi.
     */

    public final void testThreeStatesTwoFinalStates() {

        AutomatonSpecification automaton = new NaiveAutomatonSpecification();

        State q0 = automaton.addState();
        State q1 = automaton.addState();
        State q2 = automaton.addState();
        automaton.addTransition(q0, q1, new CharTransitionLabel('a'));
        automaton.addTransition(q0, q2, new CharTransitionLabel('b'));

        automaton.markAsInitial(q0);
        automaton.markAsFinal(q1);
        automaton.markAsFinal(q2);

        MinimumNumberOfOccurencesOperator oper =
            new MinimumNumberOfOccurencesOperator(3);

        NondeterministicAutomatonByThompsonApproach result =
View Full Code Here

     * Test automatu akceptujący słowo puste.
     */

    public final void testZeroRepeats() {

        AutomatonSpecification automaton = new NaiveAutomatonSpecification();

        MinimumNumberOfOccurencesOperator oper =
            new MinimumNumberOfOccurencesOperator(0);

        NondeterministicAutomatonByThompsonApproach result =
View Full Code Here

     *  Automat akceptuje słowo (ac^nb)||(bd^na).
     */

    public final void testAlternativeLoops() {

        AutomatonSpecification automaton = new NaiveAutomatonSpecification();

        State q0 = automaton.addState();
        State q1 = automaton.addState();
        State q2 = automaton.addState();
        State q3 = automaton.addState();
        State q4 = automaton.addState();
        automaton.addTransition(q0, q1, new CharTransitionLabel('a'));
        automaton.addTransition(q0, q2, new CharTransitionLabel('b'));
        automaton.addTransition(q1, q3, new CharTransitionLabel('b'));
        automaton.addTransition(q2, q4, new CharTransitionLabel('a'));
        automaton.addLoop(q1, new CharTransitionLabel('c'));
        automaton.addLoop(q2, new CharTransitionLabel('d'));


        automaton.markAsInitial(q0);
        automaton.markAsFinal(q3);
        automaton.markAsFinal(q4);

        MinimumNumberOfOccurencesOperator oper =
            new MinimumNumberOfOccurencesOperator(3);


View Full Code Here

TOP

Related Classes of pl.edu.amu.wmi.daut.base.NaiveAutomatonSpecification$NaiveTransition

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.