home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.programming      Programming issues that transcend langua      57,431 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 57,430 of 57,431   
   Stefan Ram to All   
   What I'm programming   
   30 Jan 26 15:35:53   
   
   From: ram@zedat.fu-berlin.de   
      
     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:   
      
   < ¶graphs   
     < &par   
       < &segment [This is an example.] >   
       >   
     >   
      
     and generates this output:   
      
   < ¶graphs   
     < &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.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca