top_level_navigation.gram

This example ABNF grammar recognizes a small set of global navigation commands and maps each to an application directive using semantic interpretation. Saying “go back” returns APPLICATION_BACK, “main menu” returns APPLICATION_TOP, and “goodbye”, “quit”, or “exit” returns APPLICATION_EXIT. A grammar like this is typically kept active across every state of an application, so callers can navigate or exit from anywhere rather than only at specific prompts.

Example

#ABNF 1.0;
mode voice;
language en-US;

tag-format <semantics/1.0>;

root $directive;

$directive = (go back) {out = "APPLICATION_BACK"} |
(main menu) {out = "APPLICATION_TOP"} |
(goodbye | quit | exit) {out = "APPLICATION_EXIT"};

Related articles


Was this article helpful?