** Project: FSMGenerator ** Module: FSMGenerator::examples::Cpp ** File: README ** Date: 2002.08.01 ** Author: Pavel Bekkerman (email@example.com)
** Copyright: Copyright (C) 2002 Pavel Bekkerman ** License:
** This program is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as ** published by the Free Software Foundation; either version 2 of ** the License, or (at your option) any later version. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Contact: Pavel Bekkerman (firstname.lastname@example.org)
All the explanations refer to the FSM configuration from "test.fsm" file. You can generalize the approach for any othe FSM configuration file and the software with which the generated FSM should interface. See the documentation for more information.
To run the example you should follow the next steps:
- (source distribution) Compile "fsmgenerator" from sources
make all make install rehash
- (executable distribution) Run "fsmgenerator" on "test.fsm"
fsmgenerator test.fsm Cpp .
- Compile 3 modules: Main Api FSMIsEven (the generated FSM)
- Link the modules together into an executable: e.g. "test"
If you now try to link all the files together, you will fail. The reason is that you, obiously, should notify the generated FSM about all the necessary software modules it needs to interface with. To do so, in the case of FSMIsEven generated from "test.fsm", simply add the following lines in the include section of the generated FSM (FSMIsEven.cpp):
This way the FSMIsEven will know that its callbacks are located in Main module and link with them with no problem.
5) Run executable and watch the produced output.
6) Check the produced output against FSM configuration.