picoe / Eto.Parse

Recursive descent LL(k) parser for .NET with Fluent API, BNF, EBNF and Gold Grammars
MIT License
148 stars 30 forks source link

Character ranges in EBNF grammar do not include the last character in each range #33

Closed mzabsky closed 4 years ago

mzabsky commented 7 years ago

See the code in this gist (to run it, just add Eto.Parse 1.4.0.0 from NuGet).

It fails to recognize the string and prints:

a,b,c,d,e,A,B,C,D,E,0,1,2,3,4,5,6,7,8 ChildIndex=0, Context=">>>ffFF09"

F, f and 9 are missing from the character set.

In my grammar, I have replaced character ranges with character lists and it works correctly.

tf3pm commented 7 years ago

Grammar.cs, line 220: for (char i = charRange.Start; i <= charRange.End; i++)