• What I'm programming

    From ram@ram@zedat.fu-berlin.de (Stefan Ram) to comp.programming on Fri Jan 30 15:35:53 2026
    From Newsgroup: comp.programming

    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.


    --- Synchronet 3.21b-Linux NewsLink 1.2