/** * Emits C header code for the FSM map. * * @param map emit Groovy code for this map. */ public void visit(SmcMap map) { String packageName = map.getFSM().getPackage(); String context = map.getFSM().getContext(); String mapName = map.getName(); // If a package has been specified, if (packageName != null && packageName.length() > 0) { context = packageName + "_" + context; } for (SmcState state : map.getStates()) { _source.print("extern const struct "); _source.print(context); _source.print("State "); if (packageName != null && packageName.length() > 0) { _source.print(packageName); _source.print("_"); } _source.print(mapName); _source.print("_"); _source.print(state.getInstanceName()); _source.println(";"); } return; } // end of visit(SmcMap)