I don't think I'll ever write a style guide -- I prefer to see what others
come up with.

My order of productions is (I think) similar to the traditional BNF, that
you still see in standards.  This tries to be top down, but also to keep
similar things together.  Unfortunately the two goals are not always the
same thing, so finding things can be difficult.

My suspicion is that current style is dictated by what's easier to write,
not what is easier to read.

Alphanumeric order is very non-standard, and would be harder to write, but
would have the decided advantage that you could actually find things in a
predictable, systematic way.

I don't think anybody has ever written anything on BNF style.  Now that you
can actually *do* something with your BNF, it may be time for a look at
style issues.


On Sat, Nov 21, 2015 at 11:06 PM, Ruslan Shvedov <[email protected]>
wrote:

> On Sun, Nov 22, 2015 at 8:39 AM, Paul Bennett <[email protected]>
> wrote:
>
>> Is there such a document?
>>
> My specific scenario...
>>
>> I have a grammar broken up into chunks (corresponding more or less
>> with similarity of meaning in the official SGML spec) at
>>
>> https://github.com/PWBENNETT/MarpaX-SGML/tree/master/lib/MarpaX/SGML/Grammar
>>
>> My specific question...
>>
>> Within each file, is it polite to other (human) readers to sort the
>> productions alphanumerically, or to cluster them so that things that
>> refer to each other are near each other, or something else?
>>
> ‘to cluster them so that things that refer to each other are near each
> other’ and even top-down seems to be more or less the current common
> practice according to:
>
>
> https://github.com/jeffreykegler/Marpa--R2/blob/master/cpan/lib/Marpa/R2/meta/metag.bnf
>
>
> https://github.com/jddurand/MarpaX-Languages-C-AST/blob/master/lib/MarpaX/Languages/C/AST/Grammar/ISO_ANSI_C_2011.pm#L183
>
>
> https://github.com/ronsavage/MarpaX-Languages-Lua-Parser/blob/master/lib/MarpaX/Languages/Lua/Parser.pm#L762
>
>
> https://github.com/jddurand/MarpaX-Languages-SQL-AST/blob/master/lib/MarpaX/Languages/SQL/AST/Grammar/ISO_IEC_9075_2_2003.pm#L132
>
>
>>
>>
>> Thanks,
>>
>>
>> --
>> Paul
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "marpa parser" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "marpa parser" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"marpa parser" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to