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

Examples of pl.edu.amu.wmi.daut.base.State


     * Pusty automat ktory ma byc konkatenacja pierwszych 2 automatow.
     */
    private void concatenate(AutomatonSpecification first,
            AutomatonSpecification second, AutomatonSpecification automaton) {

        State initialStateL = automaton.addState();
        State finalStateL = automaton.addState();
        automaton.markAsInitial(initialStateL);
        automaton.insert(initialStateL, first);
        for (State q : automaton.allStates()) {
            if (automaton.isFinal(q)) {
               automaton.addTransition(q, finalStateL, new EpsilonTransitionLabel());
View Full Code Here


     */
    @Override
    public AutomatonSpecification createFixedAutomaton() {

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

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

View Full Code Here

                    finalAutomaton.markAsFinal(finalAutomaton.getInitialState());
                }
            }

            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)
View Full Code Here

            AutomatonSpecification subautomaton) {

        AutomatonSpecification automatbudowany = new NaiveAutomatonSpecification();

        if (numberOfOccurrences == 0) {
            State state = automatbudowany.addState();
            automatbudowany.markAsInitial(state);
            automatbudowany.markAsFinal(state);
        }

        if (numberOfOccurrences > 0) {
            automatbudowany = subautomaton.clone();
            for (int i = 1; i < numberOfOccurrences; i++) {
                State newState = automatbudowany.addState();

                for (State state : automatbudowany.allStates()) {
                    if (automatbudowany.isFinal(state)) {
                        automatbudowany.addTransition(state,
                                    newState,
View Full Code Here

     */
    @Override
    public AutomatonSpecification createFixedAutomaton() {

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

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

View Full Code Here

    /**
     * Główna metoda klasy.
     */
    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

     * Główna metoda klasy.
     */
    public AutomatonSpecification createAutomatonFromOneAutomaton(
        AutomatonSpecification subautomaton) {

        State q = subautomaton.addState();

        subautomaton.addTransition(q, subautomaton.getInitialState(),
            new EpsilonTransitionLabel());

        subautomaton.markAsInitial(q);
View Full Code Here

     * Główna metoda klasy.
     */
    @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

     * Generuje automat.
     */
    @Override
    public AutomatonSpecification createFixedAutomaton() {
        AutomatonSpecification automaton = new NaiveAutomatonSpecification();
        State q0 = automaton.addState();
        State q1 = automaton.addState();
        automaton.markAsInitial(q0);
        automaton.markAsFinal(q1);

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

View Full Code Here

        this.charClass = c;
    }
    @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);
View Full Code Here

TOP

Related Classes of pl.edu.amu.wmi.daut.base.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.