title: Grammar for Unix command line options
body: <p>This is a homework question. I would like to write a simple parser for Unix command line options.<br>
  First, I would like to define a grammar with BNF.</p>
  
  <pre><code>Options = Option | Options, space, Option;
  Option = OptionName | OptionName, OptionArguments; 
  OptionName = '--', any character excluding '-' | OptionName, any character;
  OptionArguments = OptionArgument | OptionArguments, space, OptionArgument;
  OptionArgument = any character excluding '-' | OptionArgument, any character;
  </code></pre> 
  
  <p>("any character" here is any alphanumeric character).  </p>
  
  <p>Does it make sense ? The next question is how to add "old" Unix options, which start with a single hyphen and can be grouped together (e.g. <code>ls -lht</code>)</p>