#JSGF V1.0;

/* JSGF Grammar for Library.xml task model. See also Library.properties. */

grammar Library;

<task_name> = ( borrow [ a book ] ) { Borrow } |
              ( go to the library ) { GoToLibrary } | 
              ( choose [ a book ] ) { ChooseBook } |
              ( look [ a book ] up in the catalog ) { LookupInCatalog } |
	           ( take [ a book ] ) { TakeFromShelf } |
	           ( use search engine ) { UseSearchEngine } |
	           ( check out [ a book ] ) { CheckOut } ;

<domain_value> =  ( Stranger [ in a Strange Land ] ) { stranger } | 
                  Mindscan { mindscan } |
                  ( [ A ] Fire [ Upon the Deep ] ) { fire } |
		            Heinlein { "Heinlein" } |
                  Sawyer { "Sawyer" } |
		            Vinge { "Vinge" } ;

// no explicit discussion of decomposition classes
<decomp_name> = <NULL>;

/* ----------------------------------------------------------------------------
   Unfortunately, due to current single-grammar limitation of JSGFGrammar, we must
   copy commands.gram here.  DO NOT MODIFY HERE.
*/

public <commands> =  ( <task> | <by> | <next> | <done> | <execute> | <yes> | <no> | <status> 
                      | <clear> | <quit> | <verbose> | <debug> ) <NULL> ;

<task> = ( ( Let's | I want to | Please ) [ perform ] ) { task } <task_name> [ <values> ];

<by> = by { by } <decomp_name>;

<values> = [ on | of ] <NULL> { / } <value> ( [ and ] <NULL> { / } <value> )*;  

<value> = something | 
          ( failed { false } | succeeded { true } | <digit> | <boolean> | <domain_value> );

<digit> = zero { 0 } | one { 1 } | two { 2 } | three { 3 } | four { 4 } | five { 5 } 
	       | six { 6 } | seven { 7 } | eight { 8 } | nine { 9 };

/* note simple "failed" and "succeeded" only for proposed tasks with no declared slots */

<done> = ( done { done } [ <task_name> [ <values> ] ] ) 
         | failed { done / false } | succeeded { done / true };

<execute> = execute { execute } [ <task_name> [ <values> ] ];

<next> = [what] next { next };

<yes> = ( yes | ok ) { yes };

<no> = no { no };

<status> = status { status };

<clear> = clear { clear };

<quit> = ( quit | exit | goodbye ) { quit };

<verbose> = verbose { verbose } [ <boolean> ];

<debug> = debug { debug } [ <boolean> ];

<boolean> = ( true | on ) { true } | ( false | off ) { false };

