[SimpleParse] Case insensitivity
Brought to you by:
mcfletch
From: Paul P. <pau...@ho...> - 2003-08-23 04:55:57
|
How do people usually handle case-insensitive matching? My source text (VB) is generally well behaved with respect to case (the VB IDE formats all keywords etc) but now I am planning on trying to parse VBScript and I can't make the same assumption since a lot of it is edited outside the VB IDE. The options seem to be: 1. duplicate all keywords in the grammar (but what if someone types "SubRoutine"?) 2. convert all text to lower case prior to parsing (but my text contains strings and variable names where case is important) 3. parse the lower case text but then get the parse tree elements from the original text 4. do a pre-parse to replace all keywords with a standard form 5. assume everything is ok and try to recover when parsing fails 6. something else ... Has anyone else "solved" this problem? Paul |