The distribution include a number of samples as examples of how to write Flavor source files, and how to interface your C++ code to the code generated by the translator.
The following sample programs are provided.
put()
and get() methods. The sample also includes examples of verbatim code.stdout, and it may be large (depending on the GIF file
size).stdout.
The process for building the samples depends on if you are using a UNIX or Win32 platform.
Before building the samples, make sure that you run the configure script
located in the root directory of the distribution. This only needs to be done once. This
script will create appropriate Makefiles for all source code directories, taking into
account the details of your particular environment.
You can then build individual samples by going to their directory and entering make.
For example, to build the basic sample enter the commands:
$ cd flavor_root
$ ./configure
$ cd samples/basic
$ make
There are two ways to build the library in Win32 platforms, depending on if you use command-line or visual tools. If you use command-line tools, go to the directory where the sample is located and type:
nmake -f name.mak
where name is the name of the sample. For example, to build the
Basic sample enter:
nmake -f basic.mak
You can also use different configurations, depending on if you want a debug or release
version. The configurations are "name - Win32 Debug" and
"name - Win32 Release". You can specify which one you want
by defining the variable CFG in the nmake command line. For
example:
nmake -f basic.mak CFG="basic - Win32 Release"
By default, the debug versions are built.
The executable for each sample will be placed in the Debug or Release
subdirectory of the sample's directory. These subdirectories are created as part of the
build process.
If you use the Microsoft Developer Studio environment, load either the flavor.dsw
workshop file (located in the root directory) and select the project corresponding to the
sample you are interested in, or load directly the project file (*.dsp) from
the sample's directory. Select "Win 32 - Release" or "Win32
- Debug" as the active project configuration (the debug is the default) and
then build the project. As with the command line build, The executable for each sample
will be placed in the Debug or Release subdirectory of the
sample's directory. The project files are set up so that you can run the examples directly
from the IDE.