title: Antlr Grammar file and newline
body: <p>I am having trouble writing the grammar for antlr, I tried doing some code but not sure if its right or </p>
  
  <ol>
  <li>Strings may be surrounded in either matching quotes or matching double quotes. (This one is done already).</li>
  <li>Numbers may be integers or floating point numbers.  Numbers should not have a leading '0', unless it is the first digit to the left of the '.'.  Floating point numbers must have at lease one number to the right of the '.'.</li>
  <li>Whitespace outside of a string has no meaning.  (This one is done for you).</li>
  <li>Newlines may be either Windows (\r\n) or Unix (\n) newlines.</li>
  </ol>
  
  <p>It should have the following parsing rules:</p>
  
  <ol>
  <li>A file is made of zero or more lines.  (This one is done for you).</li>
  <li>A line is made of 0 or more cells, separated by commas.  Every line ends with a newline.</li>
  <li>A cell is either a string or a number.</li>
  </ol>
  
  <pre><code>grammar CSV;
  
  // Literals
  STRING  : '"' ~["\n\r]*? '"' | '\'' ~['\n\r]*? '\'' ;
  NUMBER  : ('0'..'9')+ '.' ('0'..'9')* EXPONENT?
          |   '.' ('0'..'9')+ EXPONENT?
          |   ('0'..'9')+ EXPONENT
          ;
  
  // Whitespace
  WS      : [ \t]+ -&gt; skip ; // ignore whitespace
  NL      :  '\n'
          | '\r\n'
          ;
  
  file: line* ;
  
  line: // ***YOUR CODE HERE***
      ;
  
  </code></pre>
  
  <p>I am not sure if NUMBER or NL are right or not.</p>