emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: MidLifeXis at PerlMonks <midlifexis@wightmanfam.org>
To: Rustom Mody <rustompmody@gmail.com>,
	emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: Formal description of Org files
Date: Fri, 15 Apr 2011 10:27:18 -0700 (PDT)	[thread overview]
Message-ID: <20123.23043.qm@web81608.mail.mud.yahoo.com> (raw)
In-Reply-To: <BANLkTimwWzdxuNAY=rMQNzppr9a-KKnggQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3157 bytes --]

This is something I would like to see adopted by the org community as well.  One 
of my main reasons is to allow other languages to be able to at least, given the 
proper configuration information (for TODO keywords, etc), to be able to deal 
with org files.  I am not quite sure where the lines should be drawn, but I am 
envisioning something like:

* The ORG format definition and actions

The format of the .org file (ORG) itself and a set of actions that are well 
behaved (add node, move node up, node id, property value, etc).  A core set of 
validation tests could be created to exercise any compliant org library.

* The configuration for a set of ORG files

The configuration for a given org (note the small "org") application, defining 
particular tweaks that an application can use to make sense of a properly 
formatted ORG file, such as valid TODO keywords, etc.  This area is muddy in my 
mind.

* The org application itself - how the org files are used in a particular 
application, or the ideas and data that set of ORG files represents, or how an 
exporter handles the data thrown at it, or....

But that is just /my/ dream.






________________________________
From: Rustom Mody <rustompmody@gmail.com>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Sent: Fri, April 15, 2011 12:13:45 PM
Subject: Re: [O] Formal description of Org files


Hi,
>
>I have a question.
>
>At FOSDEM, someone asked me if there was a formal description of the structure 
>of Org files, in some language
>that would be the input for a parser (or parser generator?) so that Org file 
>could be easily parsed.
>
>Unfortunately I did not catch the name of the format description language that 
>could be
>used for something, not did I catch the name of the person who talked to me.
>
>Can anyone help out here?  Let me know what language to use, and maybe help work 
>on such a formal description?  I
>think it would be useful to have....
>
Something like yacc (bison, antlr etc) are all 'executable BNF' languages.  When 
they work they can make the code an order of magnitude smaller and 
development/programming correspondingly easier.

That said I see a couple of hitches.

1. Grammatical handling of languages is based on the assumption of a clear and 
well defined set of tokens/lexemes.  I expect this would be harder in org than 
the typical programming languages for which yacc etc are used.  For example in 
most 'normal' languages there are comments and strings.  These involve some non 
trivial handling which is entirely hidden from the grammar by being pushed into 
the lexer.

2. Parsing a program is done for the full program as a rule (IDEs are the 
exception to the rule). Sensible parsing of program fragments, where the 
fragmenting could be quite arbitrary, is a bit of a research problem

3. As I see it, the main declarative tool (somewhat akin to grammars) that org 
uses is regular expressions.  IOW org is written with re-s strung together with 
programming logic ie vanilla elisp.  An alternative that stays within the 
regular framework (not using the heavy guns of context free parsing) may be 
ragel: http://www.complang.org/ragel/

Rusi

[-- Attachment #2: Type: text/html, Size: 4206 bytes --]

  reply	other threads:[~2011-04-15 17:27 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-15 17:13 Formal description of Org files Rustom Mody
2011-04-15 17:27 ` MidLifeXis at PerlMonks [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-09-21 12:10 Gustav Wikström
2014-09-21 12:43 ` Nicolas Goaziou
2014-10-02  8:28   ` Samuel Loury
2014-10-02 17:03     ` Nicolas Goaziou
2014-10-04 19:49   ` Gustav Wikström
2014-09-26  8:12 ` Eric S Fraga
2014-09-26 12:53   ` Grant Rettke
2014-09-26 20:51     ` Eric S Fraga
2014-10-04 19:41   ` Gustav Wikström
2014-10-06 14:22     ` Samuel Loury
2011-04-15  7:58 Carsten Dominik
2011-04-15  8:54 ` Rainer Stengele
2011-04-15 10:57   ` Carsten Dominik
2011-04-15 11:50     ` Peter Frings
2011-04-15 12:05       ` Carsten Dominik
2011-04-15 15:25         ` Jambunathan K
2011-04-20 11:57           ` Olaf.Hamann
2011-04-15 12:58 ` Christian Egli
2011-04-15 13:42   ` Peter Frings
2011-04-15 13:52     ` Filippo A. Salustri
2011-04-15 14:20 ` Wes Hardaker
2011-04-15 17:29   ` Eric Schulte
2011-04-15 18:31     ` Nick Dokos
2011-04-20 12:37       ` Olivier Schwander
2011-07-15 18:07         ` Marcelo de Moraes Serpa
2011-07-16 16:56           ` Bastien
2011-07-16 17:09             ` Nick Dokos
2011-07-16 17:12               ` Bastien
2011-07-16 18:21               ` suvayu ali
2011-07-16 18:43                 ` Nick Dokos
2011-07-17 23:14             ` Eric Schulte
2011-07-18  9:30               ` Christopher Witte
2011-07-18 23:32               ` Bastien
2011-07-18 21:02             ` Marcelo de Moraes Serpa
2011-07-18 21:03               ` Marcelo de Moraes Serpa
2011-07-18 11:04           ` Nicolas Goaziou
2011-07-18 23:35             ` Bastien
2011-07-19  6:16             ` Jambunathan K
2011-07-24 18:58               ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20123.23043.qm@web81608.mail.mud.yahoo.com \
    --to=midlifexis@wightmanfam.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=rustompmody@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).