emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Re: Formal description of Org files
@ 2011-04-15 17:13 Rustom Mody
  2011-04-15 17:27 ` MidLifeXis at PerlMonks
  0 siblings, 1 reply; 41+ messages in thread
From: Rustom Mody @ 2011-04-15 17:13 UTC (permalink / raw)
  To: emacs-orgmode

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

>
> 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: 2058 bytes --]

^ permalink raw reply	[flat|nested] 41+ messages in thread
* Re: Formal description of Org files
@ 2014-09-21 12:10 Gustav Wikström
  2014-09-21 12:43 ` Nicolas Goaziou
  2014-09-26  8:12 ` Eric S Fraga
  0 siblings, 2 replies; 41+ messages in thread
From: Gustav Wikström @ 2014-09-21 12:10 UTC (permalink / raw)
  To: Org Mode List

Hi again list.

There was a discussion many years back about a formal description of
Org files [1]. In some way that might be achieved now in org-elements,
but that still is heavily bound to elisp.

So my question is; have there been more discussions of constructing
such a formal grammar? Maybe in EBNF form. I suspect getting every
aspect of Org mode into such a description would be difficult. But
imagine the possibilities. Tools such as ANTLR and similar would
straight away have a way of parsing Org mode. Org mode source files
could be parsed in many other languages, simplifying the process of
expanding Org mode to other platforms ( Android & iOS, web ).

Further rant; To me Org mode should be less about Emacs and more about
the source file format. Let Emacs be the main carrier, but let Org
mode also expand into other domains. One way to simplify this might be
to provide the formal description so that other tools might be easier
to develop based on this grammar.

(For me, the biggest limitation of Org mode is lacking tools to
utilize it on the run. The aim of this is thus to feed thoughts on how
to simplify processes that can expand Org mode into those "more
mobile" domains).

Best regards
Gustav

[1] http://lists.gnu.org/archive/html/emacs-orgmode/2011-07/msg01282.html

> Hi Jambunathan,
>
> Jambunathan K <address@hidden> writes:
>
> > A simple worg page that "collects" the low hanging fruits to begin
> > with will be a good but firm first step in this direction.
>
> Indeed.
>
> It's on my todo list, but not with a high priority for now.
>
> If you feel like starting it, please go ahead!
>
> --
>  Bastien

^ permalink raw reply	[flat|nested] 41+ messages in thread
* Formal description of Org files
@ 2011-04-15  7:58 Carsten Dominik
  2011-04-15  8:54 ` Rainer Stengele
                   ` (2 more replies)
  0 siblings, 3 replies; 41+ messages in thread
From: Carsten Dominik @ 2011-04-15  7:58 UTC (permalink / raw)
  To: emacs-orgmode mailing list

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....

- Carsten

^ permalink raw reply	[flat|nested] 41+ messages in thread

end of thread, other threads:[~2014-10-06 14:23 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-15 17:13 Formal description of Org files Rustom Mody
2011-04-15 17:27 ` MidLifeXis at PerlMonks
  -- 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

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).