Grammar extracted by Vadim Zaytsev, see the Grammar Zoo entry for details: markup/textual/csv/bucknall/extracted
Source used for this grammar: Julian M. Bucknall, Writing a Parser for CSV Data, 11-jul-2005; 27-oct-2005 [Online]
csvFile
, csvRecord
, csvStringList
, rawString
, optionalSpaces
, whitespace
, rawField
, simpleField
, quotedField
, escapedField
, subField
), 0 root (—), 1 top (csvFile
), 1 bottom (EOF
2).csvFile ::= csvRecord"EOF"
csvRecord ::= csvStringList "\n""EOF"
csvStringList ::= rawString "," csvStringList
rawString ::= optionalSpacesrawField optionalSpaces
optionalSpaces ::=
whitespace
whitespace ::= " " "\t"
rawField ::= simpleField quotedField
simpleField ::= "\n" EOF"\t"" "",""""
quotedField ::= """ escapedField """
escapedField ::= subField """ """ escapedField
subField ::= """ EOF