diff options
Diffstat (limited to 'tests/lexers/abnf/example2.txt')
| -rw-r--r-- | tests/lexers/abnf/example2.txt | 225 |
1 files changed, 225 insertions, 0 deletions
diff --git a/tests/lexers/abnf/example2.txt b/tests/lexers/abnf/example2.txt new file mode 100644 index 00000000..493bde41 --- /dev/null +++ b/tests/lexers/abnf/example2.txt @@ -0,0 +1,225 @@ +---input--- +; This examples from WikiPedia <https://en.wikipedia.org/wiki/Augmented_Backus%E2%80%93Naur_Form>. + + postal-address = name-part street zip-part + + name-part = *(personal-part SP) last-name [SP suffix] CRLF + name-part =/ personal-part CRLF + + personal-part = first-name / (initial ".") + first-name = *ALPHA + initial = ALPHA + last-name = *ALPHA + suffix = ("Jr." / "Sr." / 1*("I" / "V" / "X")) + + street = [apt SP] house-num SP street-name CRLF + apt = 1*4DIGIT + house-num = 1*8(DIGIT / ALPHA) + street-name = 1*VCHAR + + zip-part = town-name "," SP state 1*2SP zip-code CRLF + town-name = 1*(ALPHA / SP) + state = 2ALPHA + zip-code = 5DIGIT ["-" 4DIGIT] + +---tokens--- +'; This examples from WikiPedia <https://en.wikipedia.org/wiki/Augmented_Backus%E2%80%93Naur_Form>.' Comment.Single +'\n\n ' Text +'postal-address' Name.Class +' ' Text +'=' Operator +' ' Text +'name-part' Name.Class +' ' Text +'street' Name.Class +' ' Text +'zip-part' Name.Class +'\n\n ' Text +'name-part' Name.Class +' ' Text +'=' Operator +' ' Text +'*' Operator +'(' Punctuation +'personal-part' Name.Class +' ' Text +'SP' Keyword +')' Punctuation +' ' Text +'last-name' Name.Class +' ' Text +'[' Punctuation +'SP' Keyword +' ' Text +'suffix' Name.Class +']' Punctuation +' ' Text +'CRLF' Keyword +'\n ' Text +'name-part' Name.Class +' ' Text +'=/' Operator +' ' Text +'personal-part' Name.Class +' ' Text +'CRLF' Keyword +'\n\n ' Text +'personal-part' Name.Class +' ' Text +'=' Operator +' ' Text +'first-name' Name.Class +' ' Text +'/' Operator +' ' Text +'(' Punctuation +'initial' Name.Class +' ' Text +'"."' Literal +')' Punctuation +'\n ' Text +'first-name' Name.Class +' ' Text +'=' Operator +' ' Text +'*' Operator +'ALPHA' Keyword +'\n ' Text +'initial' Name.Class +' ' Text +'=' Operator +' ' Text +'ALPHA' Keyword +'\n ' Text +'last-name' Name.Class +' ' Text +'=' Operator +' ' Text +'*' Operator +'ALPHA' Keyword +'\n ' Text +'suffix' Name.Class +' ' Text +'=' Operator +' ' Text +'(' Punctuation +'"Jr."' Literal +' ' Text +'/' Operator +' ' Text +'"Sr."' Literal +' ' Text +'/' Operator +' ' Text +'1*' Operator +'(' Punctuation +'"I"' Literal +' ' Text +'/' Operator +' ' Text +'"V"' Literal +' ' Text +'/' Operator +' ' Text +'"X"' Literal +')' Punctuation +')' Punctuation +'\n\n ' Text +'street' Name.Class +' ' Text +'=' Operator +' ' Text +'[' Punctuation +'apt' Name.Class +' ' Text +'SP' Keyword +']' Punctuation +' ' Text +'house-num' Name.Class +' ' Text +'SP' Keyword +' ' Text +'street-name' Name.Class +' ' Text +'CRLF' Keyword +'\n ' Text +'apt' Name.Class +' ' Text +'=' Operator +' ' Text +'1*4' Operator +'DIGIT' Keyword +'\n ' Text +'house-num' Name.Class +' ' Text +'=' Operator +' ' Text +'1*8' Operator +'(' Punctuation +'DIGIT' Keyword +' ' Text +'/' Operator +' ' Text +'ALPHA' Keyword +')' Punctuation +'\n ' Text +'street-name' Name.Class +' ' Text +'=' Operator +' ' Text +'1*' Operator +'VCHAR' Keyword +'\n\n ' Text +'zip-part' Name.Class +' ' Text +'=' Operator +' ' Text +'town-name' Name.Class +' ' Text +'","' Literal +' ' Text +'SP' Keyword +' ' Text +'state' Name.Class +' ' Text +'1*2' Operator +'SP' Keyword +' ' Text +'zip-code' Name.Class +' ' Text +'CRLF' Keyword +'\n ' Text +'town-name' Name.Class +' ' Text +'=' Operator +' ' Text +'1*' Operator +'(' Punctuation +'ALPHA' Keyword +' ' Text +'/' Operator +' ' Text +'SP' Keyword +')' Punctuation +'\n ' Text +'state' Name.Class +' ' Text +'=' Operator +' ' Text +'2' Operator +'ALPHA' Keyword +'\n ' Text +'zip-code' Name.Class +' ' Text +'=' Operator +' ' Text +'5' Operator +'DIGIT' Keyword +' ' Text +'[' Punctuation +'"-"' Literal +' ' Text +'4' Operator +'DIGIT' Keyword +']' Punctuation +'\n' Text |
