Re: [SimpleParse] Graceful failure ?
Brought to you by:
mcfletch
From: Mike C. F. <mcf...@ro...> - 2004-03-18 23:08:09
|
H. T. Hind wrote: >Hello, > >Is there a way to get Simpleparse to gracefully exit instead >of going into an infinite loop ? > >For example if I have a grammar definition like this > >column_specs := '<s>',ws,('<c>',ws)+,'\n' > >then the system would go into an infinite loop if the input >contains '<S>' '<c>' > > I don't see how it could with the given definition. Infinite loops occur when you have a grammar like this: column_specs := '<s>',ws,('<c>'?,ws)+,'\n' that is, where you have a group that can match entirely with a null group and then you add an outer repeating modifier. As defined, the engine allows for external parsers and the like which may, in fact, have a null-length match, so to catch this, would need to extend how mxTextTools communicates success/failure to allow for another state. It's possible to catch it, yes, but it would require some considerable work to modify the engine to be able to support the feature. Take care, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ |