public final class SmcParser
extends java.lang.Object
FSM
model. If
parse()
throws an exception, then call
getMessages()
for a list of parser warning and error
messages which explain the problems found with the
FSM definition. A new parser instance must be instantiated for
each unique input stream. A parser instance cannot be reused
for a different stream.Modifier and Type | Class and Description |
---|---|
static class |
SmcParser.TargetLanguage
The currently supported SMC target languages.
|
Modifier and Type | Field and Description |
---|---|
static int |
LANGUAGE_COUNT
SMC currently supports 17 different target languages plus
one for an error code and plus another for a second
Java implementation.
|
Constructor and Description |
---|
SmcParser(java.lang.String name,
java.io.InputStream istream,
SmcParser.TargetLanguage targetLanguage,
boolean debugFlag)
Creates a parser for the named FSM in the given input
stream.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<SmcMessage> |
getMessages()
Returns the parser's warning and error messages list.
|
SmcFSM |
parse()
Parses the named FSM in the given input stream and returns
the finite state machine.
|
public static final int LANGUAGE_COUNT
public SmcParser(java.lang.String name, java.io.InputStream istream, SmcParser.TargetLanguage targetLanguage, boolean debugFlag)
debugFlag
is true
,
then the parser and lexer debug output will be generated.name
- the finite state machine's name.istream
- the input stream contains the SMC code.targetLanguage
- Generates code for this target
language.debugFlag
- if true, turn on debug output.public SmcFSM parse() throws java.io.IOException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
getMessages()
for a list of
parser warnings and errors which explain the problems
found in the FSM defintion.java.io.IOException
- if there is a problem reading the input stream.java.lang.IllegalAccessException
- if there is a problem accessing the input stream.java.lang.reflect.InvocationTargetException
- if there is a parse error.public java.util.List<SmcMessage> getMessages()
Copyright © 2015. Charles W. Rapp. All Rights Reserved. Use is subject to license terms.