First: thank you for porting JFlex to C#. It's nice to have such a tool in C#.
However, I encountered an ArgumentOutOfRangeException raised by one lexer I generated with csflex. It seems to happen only on file of a minimum size and when the option %line is used in the lex description.
I tried to provide the smallest example that generates the bug. The following files are all enclosed in the zip file:
Bug.lex => the smallest lexer that shows a bug
Bug.txt => an input that makes the lexer raise the ArgumentOutOfRangeException
Program.cs => a small program that runs the lexer on the input and get the first token
Yylex.cs => the generated lexer with csflex 1.4
Program.exe => the executable file compiled on my machine (windows XP).
To compile it all (assuming the content of the zip is copied in a directory, one level down from csflex), I did:
../csflex Bug.lex --csharp
csc /reference:../runtime.dll Yylex.cs Program.cs
./Program.exe
I am looking forward to having a feedback from you, since I am eager to use csflex for my project! Hope this report helps!
---------------------------------------------------
copy paste of Bug.lex
using System;
using System.IO;
%%
%line
%%
.|\n { }
example that exhibits the out of range exception