ygen command line parameters

ygen accepts the following parameters:

Syntax

Shortcut

Description

Default value

help

h

Show help.

 

template_dir

t

Set template directory. This is the directory containing the template files for the generator.

./templates

source_template

s

Set source template file (for .cpp).

source.gtpl

header_template

e

Set header template file (for .hpp).

header.gtpl

out_file

o

Set name of the generated cpp and hpp files. Overwrites the source and header file names given by the state machine name.

 

namespace

n

Set namespace. This is used to define namespaces in which the generated code resides. The option can be used more than once to add multiple namespaces.

 

behavior_class

b

Set a class that contains methods and functions associated to state's and transition's behaviors and transition's guards. The option can be used more than once to add multiple behavior classes.

 

model

m

Set the state machine's model file path.

 

state_machine_name

i

Set state machine name. This will also be used as the name of the generated files.

 

state_machine_type

y

Set the type of the state machine. Type can be 'sync' for a sync state machine or 'async' for a async state machine.

sync

display_cfg

d

Display current configuration.

 

Using the command line parameters

The long syntax is applied using a double dash ('--') followed by the name of the long option, a space, and then the value.

Using the short syntax works the same but requires just one dash sign in front of the command ('-') instead of two (and of course using the short option name).

Some parameters can be repeated on the command line (namespace, behavior_class).

Example

ygen -t /templates/v1 -s first_state_machine.gtpl -e first_state_machine.gtpl --model "C:\models\fist_state_machine.ym" -n generated_code -n state_machines -i fist_state_machine