Groups | Search | Server Info | Keyboard shortcuts | Login | Register


Groups > comp.programming > #16874

What I'm programming

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From ram@zedat.fu-berlin.de (Stefan Ram)
Newsgroups comp.programming
Subject What I'm programming
Date 30 Jan 2026 15:35:53 GMT
Organization Stefan Ram
Lines 49
Expires 1 Feb 2027 11:59:58 GMT
Message-ID <programming-20260130161720@ram.dialup.fu-berlin.de> (permalink)
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
X-Trace news.uni-berlin.de n0P5rqx5A5HVZPwae9/HHAWkBrR5N+M24JByv6E1VNqGtr
Cancel-Lock sha1:W1yLVZcUUAnOXbqVGAsofG5SNuc= sha256:ZhUcFt8I50YUtgi65J6TXi5DObT4io7R/L7WFbmwXRA=
X-Copyright (C) Copyright 2026 Stefan Ram. All rights reserved. Distribution through any means other than regular usenet channels is forbidden. It is forbidden to publish this article in the Web, to change URIs of this article into links, and to transfer the body without this notice, but quotations of parts in other Usenet posts are allowed.
X-No-Archive Yes
Archive no
X-No-Archive-Readme "X-No-Archive" is set, because this prevents some services to mirror the article in the web. But the article may be kept on a Usenet archive server with only NNTP access.
X-No-Html yes
Content-Language en
Xref csiph.com comp.programming:16874

Show key headers only | View raw


  So, right now I'm programming a /plain text formatter/
  (e.g., something like RUNOFF).

  I already have a paragraph wrapper and a hyphenator
  (for English and German), but so far one needed to write
  custom code to use them.

  Now, I am writing a little input language. I already had
  implemented a syntactic framework before that can parse
  text into a tree (AST)

  So what I actually implemented today was the step from the
  input to a representation with codes for line breaks.

  For example, my program now accepts this input:

< &paragraphs
  < &par 
    < &segment [This is an example.] >
    >
  >

  and generates this output:

< &paragraphs
  < &parlist
    "This"
    [' ', ['', '']]
    "is"
    [' ', ['', '']]
    "an"
    [' ', ['', '']]
    "example."
    [' ', ['', '']]
    >>

  . The "[' ', ['', '']]" can be understood by the wrapper as a space
  with an option to break the line there.

  Disclaimer: The intermediate representation shown as "output"
  above is a data structure (a tree) and its debug output by my
  program was edited for this post to make it more readable.

  Possible continuation of my work: In a next session I might take
  the above output and transform it into the exact format my paragraph
  wrapper requires as input, so that I then can actually feed my
  paragraph to my wrapper. Hyphenation will only be implemented later.

Back to comp.programming | Previous | Next | Find similar


Thread

What I'm programming ram@zedat.fu-berlin.de (Stefan Ram) - 2026-01-30 15:35 +0000

csiph-web