%ignore "^#(.*)"; %token Comma "\,"; %token Value "[^\n\r\,]+"; %token Break "\r(\n?) | \n"; %start document; %% // with optional last break document : rows Break | rows ; // each row seprated with one break // and optional last space rows : rows Break row | row ; // values separated by spaces row : row Comma Value | Value ;