I - the input typeO - the output typepublic final class FSM2MealyParserAlternating<I,O> extends AbstractFSM2MealyParser<I,O>
Output object. This is used as follows.
If the Mealy machine that is read from the FSM file has no defined output symbol after an input word. The
last output symbol is taken from Output.computeOutput(Iterable). If a parse() method is used that does not
accept an Output object an exception is thrown when the FSM does not define an output symbol after an input
word. Furthermore, if Output.computeOutput(Iterable) returns null an exception is throws as well.
A use case where supplying an Output object to a parse() method is necessary is when one is model checking
with monitors. With alternating semantics the model checker can conclude the monitor is in a rejecting state after an
input symbol (and hence every output symbol is incorrect). To construct an input-enabled Mealy machine this parser
needs to know the correct output symbol. Note that this situation does not arise with synchronous semantics.
AbstractFSMParser.Part| Modifier and Type | Field and Description |
|---|---|
static String |
INPUT_HAS_NO_OUTPUT |
static String |
PARTIAL_FSM |
EXPECT_CHAR, EXPECT_IDENTIFIER, EXPECT_NUMBER, EXPECT_STRING, NO_SUCH_STATE, NON_DETERMINISM_DETECTED, targetInputs| Modifier and Type | Method and Description |
|---|---|
protected void |
checkTransitions(StreamTokenizer streamTokenizer)
Creates the actual Mealy machine transitions.
|
static <E> FSM2MealyParserAlternating<E,E> |
getParser(Collection<? extends E> targetInputs,
Output<E,Word<E>> output,
Function<String,E> edgeParser) |
static <I,O> FSM2MealyParserAlternating<I,O> |
getParser(Collection<? extends I> targetInputs,
Output<I,Word<O>> output,
Function<String,I> inputParser,
Function<String,O> outputParser) |
static <E> FSM2MealyParserAlternating<E,E> |
getParser(Function<String,E> edgeParser) |
static <I,O> FSM2MealyParserAlternating<I,O> |
getParser(Function<String,I> inputParser,
Function<String,O> outputParser) |
protected void |
parseTransition(StreamTokenizer streamTokenizer)
Parse a transition.
|
checkDataDefinitions, checkStateVectors, getOutputParser, getStates, getTransitions, parseDataDefinition, parseMealy, parseStateVector, readModelgetInputParser, getInputs, getPartLineNumber, getStreamTokenizer, parseclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitreadModel, readModel, readModelpublic static final String PARTIAL_FSM
public static final String INPUT_HAS_NO_OUTPUT
protected void parseTransition(StreamTokenizer streamTokenizer) throws FSMParseException, IOException
parseTransition in class AbstractFSMParser<I>streamTokenizer - tokenizer containing the inputFSMParseException - when the FSM source is invalid.IOException - see StreamTokenizer.nextToken().protected void checkTransitions(StreamTokenizer streamTokenizer) throws FSMParseException
checkTransitions in class AbstractFSMParser<I>streamTokenizer - tokenizer containing the inputFSMParseException - when the Mealy machine is partial.public static <I,O> FSM2MealyParserAlternating<I,O> getParser(@Nullable Collection<? extends I> targetInputs, @Nullable Output<I,Word<O>> output, Function<String,I> inputParser, Function<String,O> outputParser)
public static <I,O> FSM2MealyParserAlternating<I,O> getParser(Function<String,I> inputParser, Function<String,O> outputParser)
public static <E> FSM2MealyParserAlternating<E,E> getParser(@Nullable Collection<? extends E> targetInputs, @Nullable Output<E,Word<E>> output, Function<String,E> edgeParser)
public static <E> FSM2MealyParserAlternating<E,E> getParser(Function<String,E> edgeParser)
Copyright © 2019. All rights reserved.