I revised earlier "projects" for DayOfWeek and USA zip-code 
recognizers.

The zip-code recognizer handles patterns like ##### or #####-####. The 
Match and Scan routines determine the length of the pattern, if there 
is a match. The Search routines determine the length and position of 
the match within the search-string.

The DayOfWeek recognizer handles patterns like Sunday, Sun, Monday, 
etc. The Search routines also return the index of the match (Sun and 
Sunday = 0, Mon and Monday = 1, etc.).

Here are links with vc6 & vc7.1 and vc8 projects:
http://cleanspeech.sf.net/misc/DayOfWeekRe_lda_060623.zip
http://cleanspeech.sf.net/misc/ZipCodeRe_lda_060623.zip

The projects have a bunch of cppunit-like tests to confirm that the 
results are accurate. There are also HighResTimings to compare the 
speed of the recognizers to strstr and strncmp (timings are specific 
to Windows, and aren't portable to Linux).

 Caveats:
* This re2c newbie doesn't claim to know what I'm doing ... They are 
intended only as examples of relatively basic patterns that I was able 
to get to work.

* There is quite a bit of "trial and error" code that is "hold your 
nose"

Feedback appreciated on ways to improve.



Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Re2c-general mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/re2c-general

Reply via email to