File: lektion2skript.scm

package info (click to toggle)
sdc 1.0.8beta-8
  • links: PTS
  • area: contrib
  • in suites: slink
  • size: 1,400 kB
  • ctags: 874
  • sloc: lisp: 8,120; ansic: 967; makefile: 671; perl: 136; sh: 50
file content (28 lines) | stat: -rw-r--r-- 734 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
;			     -*-scheme-*-
; Filter aus Lektion den Stoff-Teil in Document

(let ()
  (define lektion
    (rdpp-rename
     'DOCUMENT
     (rdp-map
      (lambda (heading dummy stoff)
	(stream-append heading stoff))
      (rdp-cond `((#(STARTTAG) ,p-any-element)))
      (rdp-cond* `((#(STARTTAG STOFF))
		   ,(pass-otherwise)))
      (rdp-repll '()
		 (rdp-cond* `((#(STARTTAG LEKTION) ,(rdp-call lektion))
			      (#(ENDTAG STOFF))
			      ,(pass-otherwise)))))))

  (define body (rdp-cond* `((#(STARTTAG LEKTION) ,lektion)
			    ,(pass-otherwise))))

  (define document (rdp-cond `((#(STARTTAG LEKTION) ,lektion)
			       (#(STARTTAG) ,(rdpp-keep body))
			       ,(pass-otherwise))))

  (lambda (s)
    (rdp-parse document s))
  )