Overview | Package | Class | Tree | Deprecated | Index | Help
| SMC 6_0_1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## net.sf.smc.parser
Class SmcParser

    java.lang.Object
      net.sf.smc.parser.SmcParser

    public final class SmcParser

extends java.lang.Object

Reads in a finite state machine definition from an input stream and returns the `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.

Nested Class Summary
`static class` | `SmcParser.TargetLanguage` The currently supported SMC target languages.

Field Summary
`static int` | `LANGUAGE_COUNT` SMC currently supports 16 different target languages.

Constructor Summary
`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.

Method Summary
`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.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### LANGUAGE_COUNT

    public static final int LANGUAGE_COUNT

  SMC currently supports 16 different target languages.

  See Also:
    Constant Field Values

Constructor Detail

### SmcParser

    public 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. If `debugFlag` is `true`, then the parser and lexer debug output will be generated.

  Parameters:
    `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.

Method Detail

### parse

    public SmcFSM parse()
                 throws java.io.IOException,
                        java.lang.IllegalAccessException,
                        java.lang.reflect.InvocationTargetException

  Parses the named FSM in the given input stream and returns the finite state machine. If this method throws an exception, then call `getMessages()` for a list of parser warnings and errors which explain the problems found in the FSM defintion.

  Returns:
    the parser FSM model.
  Throws:
    `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.

### getMessages

    public java.util.List<SmcMessage> getMessages()

  Returns the parser's warning and error messages list.

  Returns:
    the parser's warning and error messages list.

Overview | Package | Class | Tree | Deprecated | Index | Help
| SMC 6_0_1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2009. Charles W. Rapp. All Rights Reserved. Use is subject to license terms.