Tom Gillespie <tgb...@gmail.com> writes:

> Hi Tim, David, and Gustav,

Hi

>     I am fairly certain that with only a few exceptions it is possible
> to specify a context free grammar for org syntax, followed by a second
> pass that deals specifically with markup and a few other forms,
> notably the reassembly of things like plain lists. The fact that this
> is possible because most org constructs are line oriented.

What do you think about having multiple Org grammars that parse specific
parts of an Org file and treat the rest as text blobs?  The idea is that
small tools (on smartphones) could concentrate on (say) gathering and
using the info related to one of:
+ task management
+ tangled code
+ Org file options
+ etc.

> Just a note that the linked parser.rkt [0] is indeed a BNF describing org
> syntax in the same style as a bison/yacc grammar. One of the reasons
> why I set out to work on this was precisely so that there could be a
> reference that could be consulted by the community when questions
> about extended org come up.

How complete do you feel this grammar is?

> In all my work on the grammar I have found maybe 2 or 3 places where
> the grammar could be "extended" but it isn't so much extended as it is
> regularized, where some parts of org already parse a more complex
> grammar while other very similar parts choose not to. Overall the cost
> of not parsing certain forms in certain situations adds complexity
> rather than reducing it.

Hmm.

> Overcoming this is why I started working on the grammar, because
> in the absence of a formal spec for what org should do, it is very hard
> to make changes to what it is currently doing without having nasty
> side effects.

Thanks for the effort! This could lead to Org developments on non-Enacs
platforms (smartphones & tablets)

> 0. https://github.com/tgbugs/laundry/blob/next/laundry/parser.rkt note
> the upcoming path change (which I will note in the original thread when
> it happens).

I'll see if I can look at this -- it's been decades since I played with
grammars. 

-- 
David Masterson

Reply via email to