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
Class SmcSyntaxChecker

    java.lang.Object
      net.sf.smc.model.SmcVisitor
          net.sf.smc.SmcSyntaxChecker

    public final class SmcSyntaxChecker

extends SmcVisitor

Performs a global syntax check on the various elements of the abstract syntax tree. This includes:

- Verifying that a start state has been specified and that the state exists.
- If this is C++ code generation that a header file is specified
- If this is Java code generation that the .sm fle and the context class have the same name.
- If this is TCL code generation that argument parameter types are eith value or reerence.
- That if a transition is defined multiple times within the same state that each transition definition has a unique guard.
- That transition end states are valid states (the state exists and is not the Default state).

See Also:
  `SmcElement`

Constructor Summary
`SmcSyntaxChecker(java.lang.String fsm, SmcParser.TargetLanguage targetLanguage)` Creates a syntax checker for the named FSM and target programming language.

Method Summary
`java.util.List<SmcMessage>` | `getMessages()` Returns a list of warning and error messages.
`boolean` | `isValid()` Returns `true` if no errors were found and `false` if there are syntax errors.
`void` | `visit(SmcFSM fsm)` Visits the top-level finite state machine element.
`void` | `visit(SmcGuard guard)` Visits a state tansition guard.
`void` | `visit(SmcMap map)` Visits a finite state machine submap.
`void` | `visit(SmcParameter parameter)` Visits a state transition parameter.
`void` | `visit(SmcState state)` Visits a finite state machine state.
`void` | `visit(SmcTransition transition)` Visits a finite state machine state transition.

Methods inherited from class net.sf.smc.model.SmcVisitor
`visit`

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

Constructor Detail

### SmcSyntaxChecker

    public SmcSyntaxChecker(java.lang.String fsm,
                            SmcParser.TargetLanguage targetLanguage)

  Creates a syntax checker for the named FSM and target programming language.

  Parameters:
    `fsm` - the finite state machine's name.
    `targetLanguage` - the target programming language.

Method Detail

### isValid

    public boolean isValid()

  Returns `true` if no errors were found and `false` if there are syntax errors.

  Returns:
    `true` if no errors were found and `false` if there are syntax errors.

### getMessages

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

  Returns a list of warning and error messages.

  Returns:
    a list of warning and error messages.

### visit

    public void visit(SmcFSM fsm)

  Description copied from class: `SmcVisitor`
  Visits the top-level finite state machine element.

  Overrides:
    `visit` in class `SmcVisitor`
  Parameters:
    `fsm` - The top-level finite state machine element.

### visit

    public void visit(SmcMap map)

  Description copied from class: `SmcVisitor`
  Visits a finite state machine submap.

  Overrides:
    `visit` in class `SmcVisitor`
  Parameters:
    `map` - A finite state machine submap.

### visit

    public void visit(SmcState state)

  Description copied from class: `SmcVisitor`
  Visits a finite state machine state.

  Overrides:
    `visit` in class `SmcVisitor`
  Parameters:
    `state` - A finite state machine state.

### visit

    public void visit(SmcTransition transition)

  Description copied from class: `SmcVisitor`
  Visits a finite state machine state transition.

  Overrides:
    `visit` in class `SmcVisitor`
  Parameters:
    `transition` - A finite state machine state transition.

### visit

    public void visit(SmcGuard guard)

  Description copied from class: `SmcVisitor`
  Visits a state tansition guard.

  Overrides:
    `visit` in class `SmcVisitor`
  Parameters:
    `guard` - A state tansition guard.

### visit

    public void visit(SmcParameter parameter)

  Description copied from class: `SmcVisitor`
  Visits a state transition parameter.

  Overrides:
    `visit` in class `SmcVisitor`
  Parameters:
    `parameter` - A state transition parameter.

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.