diff options
Diffstat (limited to 'tests/lexers/bnf/example.txt')
| -rw-r--r-- | tests/lexers/bnf/example.txt | 149 |
1 files changed, 149 insertions, 0 deletions
diff --git a/tests/lexers/bnf/example.txt b/tests/lexers/bnf/example.txt new file mode 100644 index 00000000..989fbf87 --- /dev/null +++ b/tests/lexers/bnf/example.txt @@ -0,0 +1,149 @@ +---input--- +; This examples from WikiPedia <https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_Form>. + + <postal-address> ::= <name-part> <street-address> <zip-part> + + <name-part> ::= <personal-part> <last-name> <opt-suffix-part> <EOL> + | <personal-part> <name-part> + + <personal-part> ::= <initial> "." | <first-name> + + <street-address> ::= <house-num> <street-name> <opt-apt-num> <EOL> + + <zip-part> ::= <town-name> "," <state-code> <ZIP-code> <EOL> + + <opt-suffix-part> ::= "Sr." | "Jr." | <roman-numeral> | "" + <opt-apt-num> ::= <apt-num> | "" + +---tokens--- +'; This examples from WikiPedia ' Text +'<' Punctuation +'https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_Form' Name.Class +'>' Punctuation +'.\n\n ' Text +'<' Punctuation +'postal-address' Name.Class +'>' Punctuation +' ' Text +'::=' Operator +' ' Text +'<' Punctuation +'name-part' Name.Class +'>' Punctuation +' ' Text +'<' Punctuation +'street-address' Name.Class +'>' Punctuation +' ' Text +'<' Punctuation +'zip-part' Name.Class +'>' Punctuation +'\n\n ' Text +'<' Punctuation +'name-part' Name.Class +'>' Punctuation +' ' Text +'::=' Operator +' ' Text +'<' Punctuation +'personal-part' Name.Class +'>' Punctuation +' ' Text +'<' Punctuation +'last-name' Name.Class +'>' Punctuation +' ' Text +'<' Punctuation +'opt-suffix-part' Name.Class +'>' Punctuation +' ' Text +'<' Punctuation +'EOL' Name.Class +'>' Punctuation +'\n | ' Text +'<' Punctuation +'personal-part' Name.Class +'>' Punctuation +' ' Text +'<' Punctuation +'name-part' Name.Class +'>' Punctuation +'\n\n ' Text +'<' Punctuation +'personal-part' Name.Class +'>' Punctuation +' ' Text +'::=' Operator +' ' Text +'<' Punctuation +'initial' Name.Class +'>' Punctuation +' "." | ' Text +'<' Punctuation +'first-name' Name.Class +'>' Punctuation +'\n\n ' Text +'<' Punctuation +'street-address' Name.Class +'>' Punctuation +' ' Text +'::=' Operator +' ' Text +'<' Punctuation +'house-num' Name.Class +'>' Punctuation +' ' Text +'<' Punctuation +'street-name' Name.Class +'>' Punctuation +' ' Text +'<' Punctuation +'opt-apt-num' Name.Class +'>' Punctuation +' ' Text +'<' Punctuation +'EOL' Name.Class +'>' Punctuation +'\n\n ' Text +'<' Punctuation +'zip-part' Name.Class +'>' Punctuation +' ' Text +'::=' Operator +' ' Text +'<' Punctuation +'town-name' Name.Class +'>' Punctuation +' "," ' Text +'<' Punctuation +'state-code' Name.Class +'>' Punctuation +' ' Text +'<' Punctuation +'ZIP-code' Name.Class +'>' Punctuation +' ' Text +'<' Punctuation +'EOL' Name.Class +'>' Punctuation +'\n\n ' Text +'<' Punctuation +'opt-suffix-part' Name.Class +'>' Punctuation +' ' Text +'::=' Operator +' "Sr." | "Jr." | ' Text +'<' Punctuation +'roman-numeral' Name.Class +'>' Punctuation +' | ""\n ' Text +'<' Punctuation +'opt-apt-num' Name.Class +'>' Punctuation +' ' Text +'::=' Operator +' ' Text +'<' Punctuation +'apt-num' Name.Class +'>' Punctuation +' | ""\n' Text |
