• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

LearnLib / automatalib / 13138848026

04 Feb 2025 02:53PM UTC coverage: 92.108% (+2.2%) from 89.877%
13138848026

push

github

mtf90
[maven-release-plugin] prepare release automatalib-0.12.0

16609 of 18032 relevant lines covered (92.11%)

1.7 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

50.0
/util/src/main/java/net/automatalib/util/automaton/builder/DFABuilderImpl.java
1
/* Copyright (C) 2013-2025 TU Dortmund University
2
 * This file is part of AutomataLib <https://automatalib.net>.
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *     http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
package net.automatalib.util.automaton.builder;
17

18
import de.learnlib.tooling.annotation.DocGenType;
19
import de.learnlib.tooling.annotation.edsl.Action;
20
import de.learnlib.tooling.annotation.edsl.Expr;
21
import de.learnlib.tooling.annotation.edsl.GenerateEDSL;
22
import net.automatalib.automaton.fsa.MutableDFA;
23

24
/**
25
 * A fluent builder for {@link net.automatalib.automaton.fsa.DFA}s.
26
 *
27
 * @param <S>
28
 *         state type
29
 * @param <I>
30
 *         input symbol type
31
 * @param <A>
32
 *         concrete automaton type
33
 */
34
@GenerateEDSL(name = "DFABuilder",
35
              syntax = "(<transOrAcc>)* withInitial (<transOrAcc>)* create",
36
              where = @Expr(name = "transOrAcc", syntax = "(from (on (loop|to))+)+|withAccepting"),
37
              constructorPublic = false,
38
              docGenType = DocGenType.COPY)
39
class DFABuilderImpl<S, I, A extends MutableDFA<S, ? super I>> extends FSABuilderImpl<S, I, A> {
40

41
    /**
42
     * Constructs a new builder with the given (mutable) automaton to write to.
43
     *
44
     * @param automaton
45
     *         the automaton to write to
46
     */
47
    @Action
48
    DFABuilderImpl(A automaton) {
49
        super(automaton);
2✔
50
    }
2✔
51

52
    // override to un-mark it as action
53
    @Override
54
    void withInitial(Object stateId, Object... stateIds) {
55
        throw new IllegalArgumentException("deterministic automata can only have a single initial state");
×
56
    }
57

58
    @Override
59
    void to(Object stateId, Object... stateIds) {
60
        throw new IllegalArgumentException("deterministic automata can only have a single target state");
×
61
    }
62
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc