| iMatix home page
| Libero home page | Libero documentation
| << | < | > | >>
Libero Libero
Version 2.32

The Dialog File Syntax

This is the skeleton.l file - it is a useful starting point for new dialogs:

!
!   myprogd.l   Dialog description for myprog.c
!
!   Written:    yy/mm/dd  My name
!   Revised:    yy/mm/dd
!
!   Syntax:  '!' comment header
!            -option[=value]
!            [ state-name ':' [ '<'Superstate-Name'>' ]...
!                  [ '(' event-nbr ')' event-name [ '->' next-
state ]
!                  [ '+' module-name ]... ]... ]...
!
-source=myprog

After-Init:
    (--) Ok                         ->
          +
    (--) Error                      ->
          + Terminate-The-Program

Defaults:
    (--) Exception                  ->
          + Terminate-The-Program

The dialog file defines a series of states: the first state in the dialog is the starting state, and the remaining states can come in any order. You cannot define the same state twice. A state carries a name, which is purely for your (the reader's) information. A state allows one or more events. The ordering of events within a state is not important. Each event looks like this:

    (--) Event-Name                 -> Next-State-Name
          + Module-To-Execute
          + Module-To-Execute
          ...
The module list is executed when that event occurs in the state. The module list can be empty. The next state name can be blank, meaning 'the current state'. Otherwise the next state name refers to another state within the dialog, excluding the initial starting state.

The module names correspond to functions, blocks, procedures, etc. in the program. Since various languages and individuals like different conventions for naming modules, Libero always uses Names-Like-This, which may refer to pieces of code labelled 'NamesLikeThis', 'names_like_this', 'NAMES-LIKE- THIS', etc.

The program always refers to events by adding the suffix '-Event'. Thus, if a dialog refers to an event 'Ok', the program will refer to 'Ok-Event', allowing for whatever name-mashing the language imposes.

A program never refers to state/next-state names. These are there only to make the dialog more readable, and useful. You could, if you wanted to, refer to states as 'S1', 'S2', 'S3', instead of 'Expecting-Token', 'Have- Number', 'Have-String'. Hahaha. I've seen people doing this.

An event name '$other' is taken to mean 'all other events'. This is shorthand for typing all other events in the dialog: any event you did not already handle in the state gets the '$other' handling.

Note that:


| << | < | > | >>
| Using Libero | The Dialog File Syntax | Libero Options | Using Exceptions | Using The Defaults State | Using Sub-Dialogs | Using Super-States | Using Templates | Using Get-External-Event | Efficiency | Care and Feeding of Dialogs | When To Use Libero
iMatix
Copyright © 1996-97 iMatix