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

Examples of pl.edu.amu.wmi.daut.base.AutomatonSpecification.addTransition()


        State q0 = automaton.addState();
        State q1 = automaton.addState();
        automaton.markAsInitial(q0);
        automaton.markAsFinal(q1);

        automaton.addTransition(q0, q1, new CharClassTransitionLabel(str));

        return automaton;
    }

    /**
 
View Full Code Here


            for (int i = 1; i < this.max; i++) {
                State newState = finalAutomaton.addState();

                for (State state : finalAutomaton.allStates()) {
                    if (finalAutomaton.isFinal(state)) {
                        finalAutomaton.addTransition(state, newState, new EpsilonTransitionLabel());
                        if (i < this.min)
                            finalAutomaton.unmarkAsFinalState(state);
                    }
                }
                finalAutomaton.insert(newState, subautomaton);
View Full Code Here

            for (int i = 1; i < numberOfOccurrences; i++) {
                State newState = automatbudowany.addState();

                for (State state : automatbudowany.allStates()) {
                    if (automatbudowany.isFinal(state)) {
                        automatbudowany.addTransition(state,
                                    newState,
                                    new EpsilonTransitionLabel());
                        automatbudowany.unmarkAsFinalState(state);
                    }
                }
View Full Code Here

        State q0 = automaton.addState();
        State q1 = automaton.addState();
        automaton.markAsInitial(q0);
        automaton.markAsFinal(q1);

        automaton.addTransition(q0, q1, new CharClassTransitionLabel(str));

        return automaton;
    }

    /**
 
View Full Code Here

            for (int i = 1; i < numberOfOccurences; i++) {
                State newState = newAutomaton.addState();

                for (State state : newAutomaton.allStates()) {
                    if (newAutomaton.isFinal(state)) {
                        newAutomaton.addTransition(state, newState, new EpsilonTransitionLabel());
                        newAutomaton.unmarkAsFinalState(state);
                    }
                }
                newAutomaton.insert(newState, subautomaton);
            }
View Full Code Here

            }
            State newState = newAutomaton.addState();
            newAutomaton.insert(newState, subautomaton);
            for (State state : newAutomaton.allStates()) {
                if (newAutomaton.isFinal(state)) {
                    newAutomaton.addTransition(state, newState, new EpsilonTransitionLabel());
                }
            }
        }
        return newAutomaton;
    }
View Full Code Here

     */
    public AutomatonSpecification createFixedAutomaton() {
        AutomatonSpecification noDigitAutomaton = new NaiveAutomatonSpecification();
        State state1 = noDigitAutomaton.addState();
        State state2 = noDigitAutomaton.addState();
        noDigitAutomaton.addTransition(state1, state2,
                new ComplementCharClassTransitionLabel("0-9"));
        noDigitAutomaton.markAsInitial(state1);
        noDigitAutomaton.markAsFinal(state2);
        return noDigitAutomaton;
    }
View Full Code Here

    @Override
    public AutomatonSpecification createFixedAutomaton() {
        AutomatonSpecification noWhitespaceAutomaton = new NaiveAutomatonSpecification();
        State state1 = noWhitespaceAutomaton.addState();
        State state2 = noWhitespaceAutomaton.addState();
        noWhitespaceAutomaton.addTransition(state1, state2,
              new ComplementCharClassTransitionLabel(WHITESPACE_CHARS));
        noWhitespaceAutomaton.markAsInitial(state1);
        noWhitespaceAutomaton.markAsFinal(state2);
        return noWhitespaceAutomaton;
    }
View Full Code Here

    @Override
    public AutomatonSpecification createFixedAutomaton() {
        AutomatonSpecification automaton = new NaiveAutomatonSpecification();
        State q0 = automaton.addState();
        State q1 = automaton.addState();
        automaton.addTransition(q0, q1,
            new CharClassTransitionLabel(charClass));
        automaton.markAsInitial(q0);
        automaton.markAsFinal(q1);

        return automaton;
View Full Code Here

        AutomatonSpecification automaton = new NaiveAutomatonSpecification();
        State q0 = automaton.addState();
        State q1 = automaton.addState();
        automaton.markAsInitial(q0);
        automaton.markAsFinal(q1);
        automaton.addTransition(q0, q1, new CharClassTransitionLabel(WHITESPACE_CHARS));
        return automaton;
    }

    /**
      * Fabryka operatora.
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.