arnaud fausse wrote:
> The objective is to find the sequence "dn: " followed by a lowercase
> alpha character in a text file.
>
> Here is the status:
> - I have managed to write a lexical definition file that is processed by
> JFlex with zero errors zero warnings
> - I wrote a java class (with main method) to scan a test file.
> No problem to compile
>
> The problem is that there is no match and I get the error message:
>
> File open OK
>
> java.lang.Error: Error: could not match input
The lexer wants to try and match *everything* it sees. If it can't
match everything, that is, if your file contains anything other than dn:
followed by a lowercase alpha character, then it will give the above error.
All you probably need is a rule that matches anything else. This is
achieved by putting this simple rule at the end of the file:
. { /* skip everything else */ }
The period matches anything.
--
Alan Eliasen | "Whenever you find you are on the side of
el...@mi... | the majority, it is time to pause and
http://futureboy.homeip.net/ | reflect." --Mark Twain
|