WebOfTrustInfo / rwot8-barcelona

RWOT8 in Barcelona, Spain (March 2019)
130 stars 101 forks source link

[Understanding DIDs in Greater Depth] Missing declarations for ALPHA and DIGIT in DID ABNF #162

Closed mwherman2000 closed 5 years ago

mwherman2000 commented 5 years ago

Reference: email from the maintainers of bnfparser2...

From: Václav Vacek vasek.vacek@gmail.com Sent: March 7, 2019 10:24 AM To: Michael Herman (Parallelspace) mwherman@parallelspace.net Cc: Vojtech Rehak xrehak@fi.muni.cz; petr.gotthard@centrum.cz Subject: Re: FW: http://arran.fi.muni.cz/bnfparser2/ is failing with a web server error

Hi Michael, please let me take over from Vojtěch - I am the author of the Bachelor thesis on the parser.

I could not reproduce the error with (probably) the same input as you but found the problem anyway - your grammar is missing the ABNF core rules (ALPHA, DIGIT in this case). Having copied these rules to your grammar, I could successfully parse the string: ALPHA = %x41-5A / %x61-7A ; A-Z / a-z DIGIT = %x30-39 ; 0-9

(As a side note, one should be able to link the core rules in the GUI - it is the last checkbox above the file upload - but it seems not to work properly. I hope the workaround is not too messy. :-) The corrected/augmented grammar file is attached.

As a bonus, I have a secret tip. Technically, it is documented somewhere in the thesis BUT...

If you put a "@" behind a nonterminal on the right side of a rule, the substrings generated by this nonterminal will be marked in the output: did = "did:" method@ ":" method-specific-idstring

Hope this helps! And thanks for trying the parser!

Best regards Václav Vacek

peacekeeper commented 5 years ago

I had the same experience with other ABNF parsers I have used in the past.

I think it's okay for specifications and papers like this one to omit the ABNF core rules like ALPHA or DIGIT, even though some parsing tools require them to be explicitly included. So I propose to close this issue.

mwherman2000 commented 5 years ago

PR https://github.com/WebOfTrustInfo/rwot8-barcelona/pull/161 has been updated to include declarations for ALPHA and DIGIT enabling the draft DID ABNF in Appendix A to pass basic validation tests.

mwherman2000 commented 5 years ago

Here's some sample results:

image

image

mwherman2000 commented 5 years ago

Closed with PR https://github.com/WebOfTrustInfo/rwot8-barcelona/pull/161