
TODO for Pretzel

- change bigforce definition to:

  \def\pretzelbigforce{\par\smallskip\noindent\kern\ind em} % bigforce


- the ITI installation still has an #include"../pascal/ptokdefs.h" in
  the pscan.h header. Make a new installation?!

- write examples for fgparse.nw

- FAQ: illegal identifier in ft file because forgot to quote the space
  in the regexp

- pretty.nw sends some strange characters to prettyprint() when a code
  chunk has ended. What characters are this? (see c.ft, currently
  fixed by ignroing all characters that can't be matched.)

- add [[unescaped]] function to pretzel library. Occurs in ftscan.nw
  and fgscan.nw. Possibly rename it.

- it seems the formatted grammar can't have empty rules, e.g.:

  foo : bar {aaa}
      |     {bbb}
  ;

  Also, the `make regression' in main fails because of that!


- handle comments

- update C prettyprinter in languages/cee

- document the faeture of the prettyprint() function: it returns the
  return value of the last call to yyparse(), i.e. 0 if all went well
  and 1 on a syntax error.

- add lx2l to pretzel-it call to have threads in formatted
  grammar/tokens. Problem: should use different suffix to stay
  backwards compatible to pretzel (e.g. fgl instead of fg)
  lx2l is in contrib/plugge; example of usage is on sun25:Java/prettyprint

- Fehlermeldungen anpassen damit sie in ein Raster fallen, welches
  noerr kennt.

- Heuristiken, die auf Fehler in der Eingabedatei hinweisen, z.B.:
   
   o backslash nicht doppelt:  \textbf statt \\textbf


noweb extensions:

- reimplement Norman's ideas in pretty.nw (i.e. choose prettyprinter
  depending on chunk name; at the moment everything is mangled using
  one prettyprinter).

- document the fact that the prettyprinter outputs stuff in verbatim
  if the parse failed

Pretzelbook:

- Spell Marc's name correctly in the index
- document feature that an empty right side of a grammar rule always
  has semantic value "null"
- document feature that -d produces .output file and tell how to read
  it.
- say how to deal with more than ten semantic values in a rule ($10?):
  split into several rules!

- discuss problem of common sequence "cancel outdent force" and that
  it would be nice to change preprocessing to tug a following indent
  in fromt of the force (but this depends on a particular style of
  prettyprinting, as Knuth's grammar's don't need the sequence that
  much)

- thank Martin J Hirzel and Micheal Plugge, Anthony Towns, David Wilson


Mails that contain suggestions:

------------------------------------------------------------------------
> I am not sure whether dpp and Pretzel hunt down header files for typedef
> (and class) definitions to aid typesetting, as CWEBx and mCWEB do; it is
> certainly not a trivial task, given the (entrirely useless) complication
> of the syntax of C declarations. It seems that mCWEB adds some
> C-specific features for organising multi-file projects, like automatic
> generation of interfacing header files; this might be difficult in a
> generic system, if you want to do it reliably (not making assumptions
> about structure of the source code). If there are things that require
> information that is present in different phases of processing, this
> would involve more of a headache to implement using simple filters than
> in one integrated program. One such thing might be to create an index
> for C++ that somehow reflects the class hierarchy, for instance
> discriminating equal identifiers when they refer to members of different
> classes (not that this is currently done in any CWEB variant, or other
> LP system for that matter). I hope this gives some indication of what I
> hinted at.
From felix@informatik.th-darmstadt.de  Wed Apr  1 18:46:17 1998
>From felix  Wed Apr  1 18:46:17 1998
Received: from isasun25 (2414@sun25 [130.83.25.3])
	by mail.isa.informatik.tu-darmstadt.de (8.8.8/8.7.1) with SMTP id SAA04187
	for <felix>; Wed, 1 Apr 1998 18:46:17 +0200 (MET DST)
Sender: felix@informatik.tu-darmstadt.de
Message-ID: <35226F57.788A@informatik.th-darmstadt.de>
Date: Wed, 01 Apr 1998 18:46:15 +0200
From: Felix Gaertner <felix@informatik.tu-darmstadt.de>
X-Mailer: Mozilla 3.01Gold (X11; I; SunOS 5.5 sun4m)
MIME-Version: 1.0
To: felix@informatik.tu-darmstadt.de
Subject: [Fwd: Multiple languages in one noweb file (was: noweb language independance)]
Content-Type: multipart/mixed; boundary="------------515461535270"
Status: RO

This is a multi-part message in MIME format.

--------------515461535270
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

-- 
=========="===================================================
Felix C. Gartner              felix@informatik.tu-darmstadt.de
Computer Science Department              TU Darmstadt, Germany

--------------515461535270
Content-Type: message/news
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Path: news.tu-darmstadt.de!news.hrz.uni-kassel.de!news-fra1.dfn.de!Cabal.CESspool!bofh.vszbr.cz!howland.erols.net!ais.net!uunet!in1.uu.net!hearst.acc.Virginia.EDU!murdoch.acc.Virginia.EDU!nr
From: Norman Ramsey <nr@cs.virginia.edu>
Newsgroups: comp.programming.literate
Subject: Multiple languages in one noweb file (was: noweb language independance)
Date: 31 Mar 1998 16:37:40 GMT
Organization: University of Virginia Computer Science
Approved: Litprog auto-moderator <litprog-admin@cs.virginia.edu>
Message-ID: <6fr64k$6i$1@murdoch.acc.Virginia.EDU>
References: <6fpj59$hu$1@news.interlog.com>
NNTP-Posting-Host: ares.cs.virginia.edu
Errors-To: /dev/null
Originator: nr@ares.cs.Virginia.EDU
Xcanpos: shelf.01/199805102201!0011729493
Xref: news.tu-darmstadt.de comp.programming.literate:4566

In article <6fpj59$hu$1@news.interlog.com>,
Francky Leyn  <Francky.Leyn@esat.kuleuven.ac.be> wrote:
>I'm using noweb to maintain a library of filters (much the same
>way noweb is operating) in multiple languages. These include:
>C, Perl, AWK, sh, and ProLog. These filters are documented in
>a SINGLE noweb file...

>1) Executable code, yes/no
>   One has to be able to make the difference between exectutable
>   files and files that aren't.

This is a Unix-ism, and in my opinion, a red herring.  If your
operating system is so broken that it can't recognize an executable
script without being told chmod +x mumble, it's not noweb's job to fix
it.

>2) line directives [different for each language]
>3) (optional) pretty printing [different for each language]
and also
4) Indexing for each language.

The architecture of noweb supports this, but nobody has gone the extra
mile to make it work.   Here's a sketch of what's needed:

  A) Identify the programming language used in each chunk.
     For preference I would do that as:
       A.1) Identify the languages used in each root chunk.
       A.2) Propagate the information from uses to defs
     For A.1, the cool way to do it is to look at the tokens in the
     chunk and identify the language that way.  The easy way to do it
     is to develop a naming convention for root chunks.  It would be
     sensible to use the same conventions that are used in Makefile, e.g.,
        <<foo.c>>, <<foo.h>>        C
	<<foo.m3>>, <<foo.i3>>	    Modula-3
	<<foo.sml>>, <<foo.sig>>    Standard ML
	<<foo.icn>>		    Icon
     And for languages that don't have Makefile conventions, one could
     play a couple of games with naming:
        <<perl: htmltoc>>           Perl Script named htmltoc
	<<awk: noidx>>		    Awk script named noidx
	<<sh: nocount>>		    Bourne Shell script named nocount
     And so on.

     If someone reading this group would care to coordinate an effort
     to develop a naming convention, I will enshrine it in the
     Hacker's guide.

     Then somebody has to write filters A.1 and A.2, which will
     decorate each code chunk with an @language directive.

Then, to implement the desiderata above, we need

  For 2), a more intelligent version of the noweb script.  I will try
  to include this as part of noweb 3, which should include support for
  making this lightning fast (ha ha ha).

  For 3), people who write prettyprinters should avoid touching chunks
  that are labelled with an incompatible @language directive.  (By
  continuing to prettyprint unlabelled code chunks, they will preserve
  existing behavior in cases where the language hasn't been determined
  explicitly.)

  For 4), if somebody prods me, I will modify autodefs to avoid
  touching chunks that are labelled with an incompatible @language
  directive.  In a more ambitious world, I should make finduses
  sensitive to @language as well---and if I have a really good day, I
  should combine all autodefs into a single filter (don't hold your
  breath).

Note that I have no time for any of this :-)


Norman

--------------515461535270--



