# A grammar file for reading BNF notation # FIXME: Too many errors! [space]: %x20\t [id]: a-zA-Z\-_+*@ [rule_name_char]: ^[]:%x20\n [notnewline]: ^\n\r [class_range_char]: ^\n\r\^\\ [class_single_char]: ^\n\r\^\\\- [any]: [double_string_char]: ^"\n [single_string_char]: ^'\n -- BNF: "#" notnewlines empty BNF BNF: predicate_section "--\n" empty rules_section BNF: rules_section BNF: spaces: [space] spaces spaces: [space] optional_spaces: [space] optional_spaces optional_spaces: empty: [space] empty empty: "\n" empty empty: "\r" empty empty: "\n#" notnewlines empty: notnewlines: [notnewline] notnewlines notnewlines: predicate_section: predicate empty "\n" predicate_section predicate_section: predicate: "[" ids "]:" optional_spaces class ids: [id] ids ids: [id] # Yes, a class specification can be empty, in which case the predicate # matches everything. class: positive_class class: "^" positive_class positive_class: positive_specification positive_class positive_class: positive_specification: class_single_chars positive_specification: class_range_chars "-" class_range_chars class_single_chars: [class_single_char] class_single_chars: "\\" [any] class_range_chars: [class_range_char] class_range_chars: "\\" [any] rules_section: rule empty "\n" rules_section rules_section: rule: rule_name optional_spaces ":" optional_spaces rule_rhs rule_name: [rule_name_char] rule_name rule_name: spaces_or_escaped_newline: optional_spaces spaces_or_escaped_newline: "\\\n" rule_rhs: ids spaces_or_escaped_newline rule_rhs rule_rhs: '[' ids ']' spaces_or_escaped_newline rule_rhs rule_rhs: '"' double_string_chars '"' spaces_or_escaped_newline rule_rhs rule_rhs: "'" single_string_chars "'" spaces_or_escaped_newline rule_rhs rule_rhs: double_string_chars: [double_string_char] double_string_chars: "\\" [any] double_string_chars: [double_string_char] double_string_char double_string_chars: "\\" [any] double_string_chars single_string_chars: [single_string_char] single_string_chars: "\\" [any] single_string_chars: [single_string_char] single_string_char single_string_chars: "\\" [any] single_string_chars