Re: [SimpleParse] Graceful failure ?
Brought to you by:
mcfletch
From: H. T. H. <hi...@co...> - 2004-03-21 01:52:26
|
On Sat, Mar 20, 2004 at 06:01:48AM -0500, Mike C. Fletcher wrote: > H. T. Hind wrote: > ... > > >>column_specs := '<s>',ws,('<c>'?,ws)+,'\n' > >> > >> > ... > > >Is there another way to define the above that avoids the loop ? > >We might not be able to anticipate all the data that we might > >encounter, hence it is essential to have the ability to fail with > >an error such that a human can intervene and fix the data. > > > > The data had '<S>' , i.e a capital S instead of a lower case s and that resulted in the app going into a loop. > This doesn't have anything to do with the data, the grammar itself is > saying "if you match nothing here, go ahead and try to match it again". > That is; to say the *exact* same thing with an engine such as > mxTextTools, you can't spell it without defining a recursion, however, > you probably don't want to anyway: My issue is , that it may not be possible to define all the valid input that we'll get. In the case where the input is invalid, I'd want the application to fail instead of going into an infinite loop. -- ---------------------------------------------------------------------- Ask a question and you're a fool for three minutes; do not ask a question and you're a fool for the rest of your life. (Chinese proverb) |