[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: Full Graph Model ABNF Test
So I tried to use the APG parser generator with the proposed Full Graph Model ABNF on a few sample XDI statements.For example, I tried to run it on this:=markus$!(+name)/!/(data:,MarkusSabadello)... and I ran into 2 problems.First problem:According to the ABNF, $!(+name) is a valid entity-singleton.This doesn't have a big effect on the overall parsing process, but it's not correct.
specific = "$" [ xdi-literal ]
member = entity-member / attribute-member / order-ref entity-member = "$" member-xref attribute-member = "$" attribute-instance order-ref = "$" order attribute-instance = "!" member-xref member-xref = "(" immutable ")" order = "*" 1*DIGIT
Second problem:The parser doesn't actually recognize the whole string as a valid XDI statement.Why? Let's look at the ABNF rule that has to be satisfied:literal = [ context ] literal-context "/!/" data-xrefNow what happens is that the parser thinks that the context part of this is matched by =markus$!(+name), which leaves nothing to match the literal-context, therefore, parsing fails.Instead, what should happen is that the context part is matched by only =markus, and that the literal-context part is matched by $!(+name).But for some reason the parser isn't able to figure that out.I know this has something to do with the parsing algorithm, with left recursion, and with backtracking, but I'd have to read up on these concepts to fully understand the problem.
terminal-pattern = *( terminal-context-type 1*non-terminal-context-type ) 1*terminal-context-type
literal = literal-context "/!/" data-xref
literal-context = attr-singleton-context / attr-member-context attr-singleton-context = [ peer ] *( [ attribute-singleton ] 1*non-attr-singleton ) 1*attribute-singleton non-attr-singleton = entity-singleton / ( collection [ member ] ) attr-member-context = [ peer ] *( [ collection attribute-member ] 1*non-attr-member ) 1*( collection attribute-member ) non-attr-member = singleton / ( collection [ entity-member ] )
I also found this, very interesting:Markus
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]