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.generator
Class SmcCppGenerator

    java.lang.Object
      net.sf.smc.model.SmcVisitor
          net.sf.smc.generator.SmcCodeGenerator
              net.sf.smc.generator.SmcCppGenerator

    public final class SmcCppGenerator

extends SmcCodeGenerator

Visits the abstract syntax tree emitting C++ code.

See Also:
  `SmcElement`, `SmcCodeGenerator`, `SmcVisitor`, `SmcOptions`

Field Summary

Fields inherited from class net.sf.smc.generator.SmcCodeGenerator
`_accessLevel, _castType, _debugLevel, _genericFlag, _graphLevel, _guardCount, _guardIndex, _headerDirectory, _indent, _noCatchFlag, _noExceptionFlag, _noStreamsFlag, _reflectFlag, _serialFlag, _source, _srcDirectory, _srcfileBase, _syncFlag, DEBUG_LEVEL_0, DEBUG_LEVEL_1, GRAPH_LEVEL_0, GRAPH_LEVEL_1, GRAPH_LEVEL_2, NO_DEBUG_OUTPUT, NO_GRAPH_LEVEL`

Constructor Summary
`SmcCppGenerator(net.sf.smc.generator.SmcOptions options)` Creates a C++ code generator for the given options.

Method Summary
`void` | `visit(SmcAction action)` Emits C++ code for this FSM action.
`void` | `visit(SmcFSM fsm)` Emits C++ code for the finite state machine.
`void` | `visit(SmcGuard guard)` Emits C++ code for this FSM transition guard.
`void` | `visit(SmcMap map)` Emits C++ code for the FSM map.
`void` | `visit(SmcParameter parameter)` Emits C++ code for this transition parameter.
`void` | `visit(SmcState state)` Emits C++ code for this FSM state.
`void` | `visit(SmcTransition transition)` Emits C++ code for this FSM state transition.

Methods inherited from class net.sf.smc.generator.SmcCodeGenerator
`allNilEndStates, escape, isLoopback, scopeStateName, setSource, sourceFile`

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

Constructor Detail

### SmcCppGenerator

    public SmcCppGenerator(net.sf.smc.generator.SmcOptions options)

  Creates a C++ code generator for the given options.

  Parameters:
    `options` - The target code generator options.

Method Detail

### visit

    public void visit(SmcFSM fsm)

  Emits C++ code for the finite state machine. This method generates the following code: `

       %{ %} raw source code - if any

       #include %include header file
          // #include "context_sm.h"
          // (If the -headerd option is used, then this is generated:
          // #include "header dir/context.h")
          //
          // using namespace statemap;
          // using namespace %import namespace
          //
          // (put namespace a { namespace b ... if %package defined.)
          //
          // Static class declarations.
          // map name_state name map name::state("map name::state name", index)

  `

  Overrides:
    `visit` in class `SmcVisitor`
  Parameters:
    `fsm` - emit C# code for this finite state machine.

### visit

    public void visit(SmcMap map)

  Emits C++ code for the FSM map.

  Overrides:
    `visit` in class `SmcVisitor`
  Parameters:
    `map` - emit C++ code for this map.

### visit

    public void visit(SmcState state)

  Emits C++ code for this FSM state.

  Overrides:
    `visit` in class `SmcVisitor`
  Parameters:
    `state` - emits C++ code for this state.

### visit

    public void visit(SmcTransition transition)

  Emits C++ code for this FSM state transition.

  Overrides:
    `visit` in class `SmcVisitor`
  Parameters:
    `transition` - emits C++ code for this state transition.

### visit

    public void visit(SmcGuard guard)

  Emits C++ code for this FSM transition guard.

  Overrides:
    `visit` in class `SmcVisitor`
  Parameters:
    `guard` - emits C++ code for this transition guard.

### visit

    public void visit(SmcAction action)

  Emits C++ code for this FSM action.

  Overrides:
    `visit` in class `SmcVisitor`
  Parameters:
    `action` - emits C++ code for this action.

### visit

    public void visit(SmcParameter parameter)

  Emits C++ code for this transition parameter.

  Overrides:
    `visit` in class `SmcVisitor`
  Parameters:
    `parameter` - emits C++ code for this 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.