OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

xdi message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Re: [xdi] ABNF pattern question - maybe for Joseph?

How about these rewrites?

collection-context = singleton collection-context / collection collection-context / collection member collection-context / collection
literal-context    = singleton    literal-context / collection    literal-context / collection member    literal-context / collection attribute-member / attribute-singleton

The [ peer ] that was at the beginning has to be moved off to another rule though.

On Mar 3, 2013, at 11:32 PM, Drummond Reed <drummond.reed@xdi.org> wrote:

I'm posing this question of everyone on the TC but hoping Joseph might have some time to dig into it. 

When I completed my action item from last Fridays's telecon to shorten the Ful Graph ABNF by condensing some of the rules (see the 2013-03-02 post to https://wiki.oasis-open.org/xdi/XdiAbnf/Discussion), I also update it with Markus' simpler version of the collection-context and literal-context rules. See the bolded lines below (these most likely wrap in this email).
literal                 = literal-value / literal-ref
literal-value           = literal-context "/!/" data-xref
literal-ref             = literal-context "/!/()"                                                              <== NEW

context                 = peer / peer-relative-context / relative-context
peer                    = 1*xref
peer-relative-context   = peer relative-context
relative-context        = 1*( singleton / ( collection [ member ] ) )

collection-context      = [ peer ] *( singleton / ( collection [ member ] ) ) collection

member-context          = member [ relative-context ]

literal-context         = [ peer ] *( singleton / ( collection [ member ] ) ) ( attribute-singleton / collection attribute-member )   
The problem is that, as Markus noted, these don't actually work with the Interactive APG parser. I did a little testing this weekend and found it's because the "tail matching" pattern itself doesn't work. For example, I created this very simple test of an ABNF _expression_ that would match a string containing any combination of letters and digits as long as it ended it a digit:

ID        =  *( DIGIT / ALPHA ) DIGIT
ALPHA     =  %x41-5A / %x61-7A   ; A-Z / a-z
DIGIT     =  %x30-39     ; 0-9

As I suspected, it doesn't work. As Markus detected last week, the greedy algorithm "sucks up" all the letters and digits in the *( DIGIT / ALPHA )rule and doesn't leave any to match the final DIGIT rule. 

So, here's my question to Joseph (or anyone else who's deep enough into ABNF to answer it): is there an ABNF pattern I'm missing that's able to match the tail token in a sequence of tokens?

That's what we need for the collection-context and literal-context rules in the Full Graph ABNF.



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]