Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#1 Optional children of repeating f/o group

open
nobody
None
7
2002-06-30
2002-06-30
Mike C. Fletcher
No

Currently the engine cannot distinguish between a
compound item (such as a Table) that fails, but is
satisfied, and one that succeeds. As a result, there's
an endless loop generated when trying to parse a
repeating group (f/o with a single optional or seq with
all optional).

The approaches I can see:

Make the objectgenerator code try to figure out when
the situation would occur and raise an error. (This is
going to be ugly code: determine whether children are
optional (recursively (which is a problem with
self-referencing items)), or more precisely, whether an
item can match a 0-width string)

Make the engine capable of reporting success, failure
and contentment explicitly. Alter tag-table generators
to allow the third state jumps (which completely
changes the mx.TextTools API). Not a great solution
either.

Discussion