[ale] Parsing/compiler/interpreter discussions now on the GoLUG mailing list

Steve Litt slitt at troubleshooters.com
Mon Nov 13 14:59:53 EST 2023


Bob Toxen said on Mon, 13 Nov 2023 10:53:54 -0500

>Oh, what fun stuff.  CS154.  But a killer class!  Some of us prefer
>to call it Backus-Normal form.
>
>Bob

Cool, you've had some training!

I'm (very slowly) creating a author once, translate to any format
"language" whose basic tenants are:

* Plain TeX, if you're an ASCII kinda guy you can do it with a-z, A-Z,
  0-9, and punctuation.

* Designed from the ground up to be keyboard typist fast and friendly.
  Telling it that this paragraph is of class "story" should not consume
  enough of your mind to pull it away from what you're writing about.
 
* CLI. If you're a GUI kinda guy you can run it in a terminal emulator.
  I'm trying to make it so keyboard friendly there will never be the
  slightest need to reach for a mouse.

* Not depend on LyX, Emacs, or (urk) Pandoc. Editor agnostic.

So I'm thinking a document is a series of, for lack of a better word,
"chunks", where each chunk can be a paragraph, a div section, a pre
section, a table of contents, an index, a bibliograpy, an image, a
video, an external link, or an internal reference. A paragraph can
include links, images, spans, tokens, or text (just plain content). So
far I have the following BNF:


<doc> ::= | <chunk> | <doc> <chunk>

<chunk> ::= <par> | <div> | <pre> | <toc> | <idx> | <bib> | <img> |
<vid> | <link> | <ref> 

<par> ::= | <link> <par> | <image> <par> | <span> <par> | <token> <par>
| <text> <par> | <text>

Does the preceding look accurate? Do you have suggestions?

The thing I can't figure out yet is that a chunk can have an ID or a
style class, and I don't know how to accommodate this in a BNF. I also
don't know how to have optional things in a rule. After all, a <par>
might not have a class (it's just standard, no need to type in a
class), and almost no paragraphs have IDs.

Thanks,

SteveT

Steve Litt 

Autumn 2023 featured book: Rapid Learning for the 21st Century
http://www.troubleshooters.com/rl21


More information about the Ale mailing list