In grammar-based recognition, to make the robot recognize your voice commands we need to specify the set of possible commands. Most of the commands will share some parts, like for instance: run forward with maximum speed and run backward with maximum speed. It sounds inefficient to enumerate each command separately, as there will be a lot of redundant stuff in such configuration file.
That is why, instead of explicitly write every possible commands, we define a grammar file, which allows us to do the same in a more compact way:
#JSGF V1.0; grammar robot; <forward> = run forward; <backward> = run backward; <stop> = stop; <max> = (<forward> | <backward> ) with maximum speed; public <item> = <forward> | <stop> | <backward> | <max> ;