Ada-Rapporteur-Group / User-Community-Input

Ada User Community Input Working Group - Github Mirror Prototype
27 stars 1 forks source link

Improvement for plain text version of RM (in particular Annex P Syntax Rules) #25

Closed okellogg closed 1 year ago

okellogg commented 2 years ago

The plain text version of the RM and AARM Annex P Syntax Rules suffers quite seriously from the loss of bold typeface formatting. See e.g. the section 3.5 rule range_constraint :

range_constraint ::=  range range

In the PDF and HMTL version, this is

    range_constraint ::= range range

making it clear that the first range is a keyword.

In many parsing tools there exists the convention of using capital letters for keywords. I propose using this convention for the text version. The example from above would then be

range_constraint ::=  RANGE range
ARG-Editor commented 2 years ago

The plain text version is mainly provided for operations like text searches and the extraction of code. For the latter in particular, you don't want the keywords in UPPER CASE. (No one wants all of the specs in their compiler to have UPPER CASE keywords.

In any case, the way the formatter works would not easily allow such a change. The design of the formatter keeps the output format separate from the code that actually does formatting. So there is a class defined for output (which is the same for every kind of output), and the formatter itself doesn't care what kind of output you are using.

So you could either add (to the formatter tool) a setting that would put all of the text that is in bold in UPPER CASE (not just keywords), or add a setting that would put all of the keywords in UPPER CASE (regardless of the output format). But either way, it wouldn't make sense to use such a setting on the distributed text RM since it would interfere with one of the main purposes of that version.

Of course, you or any other interested user could update the formatter (which is open source) to do that for your own private version.

okellogg commented 1 year ago

Of course, you or any other interested user could update the formatter (which is open source) to do that for your own private version.

I made a standalone script that generates a format more geared towards parser grammars than the Annex P text format.