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

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


    /**
     * 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));

        return automaton;
    }
View Full Code Here

* Klasa reprezentująca znak "dźwiękowy" (znak o kodzie 7, \a w wyrażeniach regularnych).
*/
public class BellCharacterOperator extends NullaryRegexpOperator {
    @Override
    public AutomatonSpecification createFixedAutomaton() {
        return new NaiveAutomatonSpecification().makeOneTransitionAutomaton('\7');
    }
View Full Code Here

    public CharClassOperator(String c) {
        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);

        return automaton;
    }
View Full Code Here

     * Generuje automat składający się tylko z jednego znaku.
     */
    @Override
    public AutomatonSpecification createFixedAutomaton() {

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

*/
public class TabOperator extends NullaryRegexpOperator {

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

public class WhitespaceOperator extends NullaryRegexpOperator {
    private static final String WHITESPACE_CHARS = "\t\n\f\r \u000B";

    @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(WHITESPACE_CHARS));
        return automaton;
    }
View Full Code Here

     * Główna metoda klasy.
     */
    @Override
    public AutomatonSpecification createFixedAutomaton() {

        AutomatonSpecification automaton = new NaiveAutomatonSpecification();
        char a = '0';
        char b = '9';
        State q0 = automaton.addState();
        State q1 = automaton.addState();
        automaton.addTransition(q0, q1, new CharRangeTransitionLabel(a, b));
        automaton.markAsInitial(q0);
        automaton.markAsFinal(q1);

        return automaton;
    }
View Full Code Here

        return character;
    }

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

        }
    }

    @Override
    public final AutomatonSpecification createFixedAutomaton() {
        NaiveAutomatonSpecification spec = new NaiveAutomatonSpecification();

        State q0 = spec.addState();
        spec.markAsInitial(q0);

        State q;
        for (int i = this.from; i <= this.to; ++i) {
            q = spec.addTransitionSequence(q0, Integer.toString(i));
            spec.markAsFinal(q);
        }

        return spec;
    }
View Full Code Here

TOP

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

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.