Class FSM2MealyParserIO<I,O,A extends MutableMealyMachine<Integer,I,?,O>>
- java.lang.Object
-
- net.automatalib.serialization.fsm.parser.AbstractFSMParser<I>
-
- net.automatalib.serialization.fsm.parser.AbstractFSM2MealyParser<I,O,A>
-
- net.automatalib.serialization.fsm.parser.FSM2MealyParserIO<I,O,A>
-
- Type Parameters:
I- the input typeO- the output typeA- the parsed automaton type
- All Implemented Interfaces:
ModelDeserializer<A>
public final class FSM2MealyParserIO<I,O,A extends MutableMealyMachine<Integer,I,?,O>> extends AbstractFSM2MealyParser<I,O,A>
Parse a Mealy machine from an FSM source with straightforward edge semantics (as compared toFSM2MealyParserAlternating).
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.automatalib.serialization.fsm.parser.AbstractFSMParser
AbstractFSMParser.Part
-
-
Field Summary
-
Fields inherited from class net.automatalib.serialization.fsm.parser.AbstractFSMParser
EXPECT_CHAR, EXPECT_IDENTIFIER, EXPECT_NUMBER, EXPECT_STRING, NO_SUCH_STATE, NON_DETERMINISM_DETECTED, targetInputs
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckTransitions(StreamTokenizer streamTokenizer)Perform some actions after all transitions have been parsed.static <E> ModelDeserializer<CompactMealy<E,E>>getParser(@Nullable Collection<? extends E> targetInputs, Function<String,E> edgeParser)Constructs aModelDeserializerthat reads aMealyMachinedescription and writes it into aCompactMealy.static <I,O>
ModelDeserializer<CompactMealy<I,O>>getParser(@Nullable Collection<? extends I> targetInputs, Function<String,I> inputParser, Function<String,O> outputParser)Constructs aModelDeserializerthat reads aMealyMachinedescription and writes it into aCompactMealy.static <I,O,A extends MutableMealyMachine<Integer,I,?,O>>
ModelDeserializer<A>getParser(@Nullable Collection<? extends I> targetInputs, Function<String,I> inputParser, Function<String,O> outputParser, AutomatonCreator<A,I> creator)Constructs aModelDeserializerthat reads aMealyMachinedescription and writes it into a givenMutableMealyMachine.static <E> ModelDeserializer<CompactMealy<E,E>>getParser(Function<String,E> edgeParser)Constructs aModelDeserializerthat reads aMealyMachinedescription and writes it into aCompactMealy.static <I,O>
ModelDeserializer<CompactMealy<I,O>>getParser(Function<String,I> inputParser, Function<String,O> outputParser)Constructs aModelDeserializerthat reads aMealyMachinedescription and writes it into aCompactMealy.protected voidparseTransition(StreamTokenizer streamTokenizer)Parse a transition.-
Methods inherited from class net.automatalib.serialization.fsm.parser.AbstractFSM2MealyParser
checkDataDefinitions, checkStateVectors, getOutputParser, getStates, getTransitions, parseDataDefinition, parseMealy, parseStateVector, readModel
-
Methods inherited from class net.automatalib.serialization.fsm.parser.AbstractFSMParser
getInputParser, getInputs, getPartLineNumber, getStreamTokenizer, parse
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.automatalib.serialization.ModelDeserializer
readModel, readModel, readModel
-
-
-
-
Method Detail
-
parseTransition
protected void parseTransition(StreamTokenizer streamTokenizer) throws IOException, FormatException
Parse a transition.- Specified by:
parseTransitionin classAbstractFSMParser<I>- Parameters:
streamTokenizer- tokenizer containing the input- Throws:
net.automatalib.serialization.fsm.parser.FSMFormatException- when the transition is illegal.IOException- seeStreamTokenizer.nextToken().FormatException- when the FSM source is invalid.
-
checkTransitions
protected void checkTransitions(StreamTokenizer streamTokenizer)
Description copied from class:AbstractFSMParserPerform some actions after all transitions have been parsed.- Specified by:
checkTransitionsin classAbstractFSMParser<I>- Parameters:
streamTokenizer- tokenizer containing the input
-
getParser
public static <E> ModelDeserializer<CompactMealy<E,E>> getParser(Function<String,E> edgeParser)
Constructs aModelDeserializerthat reads aMealyMachinedescription and writes it into aCompactMealy.- Type Parameters:
E- symbol type- Parameters:
edgeParser- the transformer of String representatives to (same-typed) input/output symbols- Returns:
- a
ModelDeserializerthat reads aMealyMachinedescription
-
getParser
public static <I,O> ModelDeserializer<CompactMealy<I,O>> getParser(Function<String,I> inputParser, Function<String,O> outputParser)
Constructs aModelDeserializerthat reads aMealyMachinedescription and writes it into aCompactMealy.- Type Parameters:
I- input symbol typeO- output symbol type- Parameters:
inputParser- the transformer of String representatives to input alphabet symbolsoutputParser- the transformer of String representatives to output alphabet symbols- Returns:
- a
ModelDeserializerthat reads aMealyMachinedescription
-
getParser
public static <E> ModelDeserializer<CompactMealy<E,E>> getParser(@Nullable Collection<? extends E> targetInputs, Function<String,E> edgeParser)
Constructs aModelDeserializerthat reads aMealyMachinedescription and writes it into aCompactMealy.- Type Parameters:
E- symbol type- Parameters:
targetInputs- the collection of symbols the parsing should be constrained to (may benullif unconstrained)edgeParser- the transformer of String representatives to (same-typed) input/output symbols- Returns:
- a
ModelDeserializerthat reads aMealyMachinedescription
-
getParser
public static <I,O> ModelDeserializer<CompactMealy<I,O>> getParser(@Nullable Collection<? extends I> targetInputs, Function<String,I> inputParser, Function<String,O> outputParser)
Constructs aModelDeserializerthat reads aMealyMachinedescription and writes it into aCompactMealy.- Type Parameters:
I- input symbol typeO- output symbol type- Parameters:
targetInputs- the collection of symbols the parsing should be constrained to (may benullif unconstrained)inputParser- the transformer of String representatives to input alphabet symbolsoutputParser- the transformer of String representatives to output alphabet symbols- Returns:
- a
ModelDeserializerthat reads aMealyMachinedescription
-
getParser
public static <I,O,A extends MutableMealyMachine<Integer,I,?,O>> ModelDeserializer<A> getParser(@Nullable Collection<? extends I> targetInputs, Function<String,I> inputParser, Function<String,O> outputParser, AutomatonCreator<A,I> creator)
Constructs aModelDeserializerthat reads aMealyMachinedescription and writes it into a givenMutableMealyMachine.- Type Parameters:
I- input symbol typeO- output symbol typeA- (concrete) automaton type- Parameters:
targetInputs- the collection of symbols the parsing should be constrained to (may benullif unconstrained)inputParser- the transformer of String representatives to input alphabet symbolsoutputParser- the transformer of String representatives to output alphabet symbolscreator- the creator to construct the concrete automaton instance- Returns:
- a
ModelDeserializerthat reads aMealyMachinedescription
-
-