Grammar connected by Vadim Zaytsev, see the Grammar Zoo entry for details: markup/textual/csv/bucknall/connected
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
), 1 root (csvFile
), 0 top (—), 1 bottom (EOF
4).csvFile ::=
csvRecord
EOFcsvRecord ::= 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