annotate lisp/progmodes/ebnf2ps.el @ 38032:395d845834fe

(texinfo-format-syntax-table): Change syntax of " and \ to "." (punctuation).
author Miles Bader <miles@gnu.org>
date Thu, 14 Jun 2001 02:54:06 +0000
parents c2604e531b66
children b174db545cfd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1 ;;; ebnf2ps --- Translate an EBNF to a syntatic chart on PostScript
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2
35888
c2604e531b66 Eliminate time-stamp functions.
Gerd Moellmann <gerd@gnu.org>
parents: 34803
diff changeset
3 ;; Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5 ;; Author: Vinicius Jose Latorre <vinicius@cpqd.com.br>
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
6 ;; Maintainer: Vinicius Jose Latorre <vinicius@cpqd.com.br>
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
7 ;; Keywords: wp, ebnf, PostScript
35888
c2604e531b66 Eliminate time-stamp functions.
Gerd Moellmann <gerd@gnu.org>
parents: 34803
diff changeset
8 ;; Time-stamp: <2001/02/02 15:23:39 vinicius>
c2604e531b66 Eliminate time-stamp functions.
Gerd Moellmann <gerd@gnu.org>
parents: 34803
diff changeset
9 ;; Version: 3.5
30552
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
10 ;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/Emacs.html
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
11
27539
9299c470e566 Update copyright.
Gerd Moellmann <gerd@gnu.org>
parents: 27495
diff changeset
12 ;; This file is part of GNU Emacs.
9299c470e566 Update copyright.
Gerd Moellmann <gerd@gnu.org>
parents: 27495
diff changeset
13
9299c470e566 Update copyright.
Gerd Moellmann <gerd@gnu.org>
parents: 27495
diff changeset
14 ;; GNU Emacs is free software; you can redistribute it and/or modify
9299c470e566 Update copyright.
Gerd Moellmann <gerd@gnu.org>
parents: 27495
diff changeset
15 ;; it under the terms of the GNU General Public License as published by
9299c470e566 Update copyright.
Gerd Moellmann <gerd@gnu.org>
parents: 27495
diff changeset
16 ;; the Free Software Foundation; either version 2, or (at your option)
9299c470e566 Update copyright.
Gerd Moellmann <gerd@gnu.org>
parents: 27495
diff changeset
17 ;; any later version.
9299c470e566 Update copyright.
Gerd Moellmann <gerd@gnu.org>
parents: 27495
diff changeset
18
9299c470e566 Update copyright.
Gerd Moellmann <gerd@gnu.org>
parents: 27495
diff changeset
19 ;; GNU Emacs is distributed in the hope that it will be useful,
9299c470e566 Update copyright.
Gerd Moellmann <gerd@gnu.org>
parents: 27495
diff changeset
20 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
9299c470e566 Update copyright.
Gerd Moellmann <gerd@gnu.org>
parents: 27495
diff changeset
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9299c470e566 Update copyright.
Gerd Moellmann <gerd@gnu.org>
parents: 27495
diff changeset
22 ;; GNU General Public License for more details.
9299c470e566 Update copyright.
Gerd Moellmann <gerd@gnu.org>
parents: 27495
diff changeset
23
9299c470e566 Update copyright.
Gerd Moellmann <gerd@gnu.org>
parents: 27495
diff changeset
24 ;; You should have received a copy of the GNU General Public License
9299c470e566 Update copyright.
Gerd Moellmann <gerd@gnu.org>
parents: 27495
diff changeset
25 ;; along with GNU Emacs; see the file COPYING. If not, write to the
9299c470e566 Update copyright.
Gerd Moellmann <gerd@gnu.org>
parents: 27495
diff changeset
26 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
9299c470e566 Update copyright.
Gerd Moellmann <gerd@gnu.org>
parents: 27495
diff changeset
27 ;; Boston, MA 02111-1307, USA.
9299c470e566 Update copyright.
Gerd Moellmann <gerd@gnu.org>
parents: 27495
diff changeset
28
35888
c2604e531b66 Eliminate time-stamp functions.
Gerd Moellmann <gerd@gnu.org>
parents: 34803
diff changeset
29 (defconst ebnf-version "3.5"
c2604e531b66 Eliminate time-stamp functions.
Gerd Moellmann <gerd@gnu.org>
parents: 34803
diff changeset
30 "ebnf2ps.el, v 3.5 <2001/02/02 vinicius>
c2604e531b66 Eliminate time-stamp functions.
Gerd Moellmann <gerd@gnu.org>
parents: 34803
diff changeset
31
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
32
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
33 Vinicius's last change version. When reporting bugs, please also
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
34 report the version of Emacs, if any, that ebnf2ps was running with.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
35
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
36 Please send all bug fixes and enhancements to
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
37 Vinicius Jose Latorre <vinicius@cpqd.com.br>.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
38 ")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
39
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
40
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
41 ;;; Commentary:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
42
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
43 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
44 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
45 ;; Introduction
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
46 ;; ------------
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
47 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
48 ;; This package translates an EBNF to a syntatic chart on PostScript.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
49 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
50 ;; To use ebnf2ps, insert in your ~/.emacs:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
51 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
52 ;; (require 'ebnf2ps)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
53 ;;
30552
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
54 ;; ebnf2ps uses ps-print package (version 5.2.3 or later), so see ps-print to
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
55 ;; know how to set options like landscape printing, page headings, margins,
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
56 ;; etc.
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
57 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
58 ;; NOTE: ps-print zebra stripes and line number options doesn't have effect on
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
59 ;; ebnf2ps, they behave as it's turned off.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
60 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
61 ;; For good performance, be sure to byte-compile ebnf2ps.el, e.g.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
62 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
63 ;; M-x byte-compile-file <give the path to ebnf2ps.el when prompted>
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
64 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
65 ;; This will generate ebnf2ps.elc, which will be loaded instead of ebnf2ps.el.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
66 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
67 ;; ebnf2ps was tested with GNU Emacs 20.4.1.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
68 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
69 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
70 ;; Using ebnf2ps
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
71 ;; -------------
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
72 ;;
30552
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
73 ;; ebnf2ps provides six commands for generating PostScript syntatic chart
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
74 ;; images of Emacs buffers:
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
75 ;;
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
76 ;; ebnf-print-buffer
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
77 ;; ebnf-print-region
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
78 ;; ebnf-spool-buffer
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
79 ;; ebnf-spool-region
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
80 ;; ebnf-eps-buffer
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
81 ;; ebnf-eps-region
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
82 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
83 ;; These commands all perform essentially the same function: they generate
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
84 ;; PostScript syntatic chart images suitable for printing on a PostScript
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
85 ;; printer or displaying with GhostScript. These commands are collectively
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
86 ;; referred to as "ebnf- commands".
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
87 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
88 ;; The word "print", "spool" and "eps" in the command name determines when the
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
89 ;; PostScript image is sent to the printer (or file):
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
90 ;;
30552
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
91 ;; print - The PostScript image is immediately sent to the printer;
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
92 ;;
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
93 ;; spool - The PostScript image is saved temporarily in an Emacs buffer.
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
94 ;; Many images may be spooled locally before printing them. To
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
95 ;; send the spooled images to the printer, use the command
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
96 ;; `ebnf-despool'.
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
97 ;;
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
98 ;; eps - The PostScript image is immediately sent to a EPS file.
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
99 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
100 ;; The spooling mechanism is the same as used by ps-print and was designed for
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
101 ;; printing lots of small files to save paper that would otherwise be wasted on
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
102 ;; banner pages, and to make it easier to find your output at the printer (it's
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
103 ;; easier to pick up one 50-page printout than to find 50 single-page
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
104 ;; printouts). As ebnf2ps and ps-print use the same Emacs buffer to spool
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
105 ;; images, you can intermix the spooling of ebnf2ps and ps-print images.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
106 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
107 ;; ebnf2ps use the same hook of ps-print in the `kill-emacs-hook' so that you
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
108 ;; won't accidentally quit from Emacs while you have unprinted PostScript
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
109 ;; waiting in the spool buffer. If you do attempt to exit with spooled
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
110 ;; PostScript, you'll be asked if you want to print it, and if you decline,
30552
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
111 ;; you'll be asked to confirm the exit; this is modeled on the confirmation
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
112 ;; that Emacs uses for modified buffers.
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
113 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
114 ;; The word "buffer" or "region" in the command name determines how much of the
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
115 ;; buffer is printed:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
116 ;;
30552
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
117 ;; buffer - Print the entire buffer.
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
118 ;;
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
119 ;; region - Print just the current region.
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
120 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
121 ;; Two ebnf- command examples:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
122 ;;
30552
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
123 ;; ebnf-print-buffer - translate and print the entire buffer, and send it
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
124 ;; immediately to the printer.
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
125 ;;
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
126 ;; ebnf-spool-region - translate and print just the current region, and
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
127 ;; spool the image in Emacs to send to the printer
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
128 ;; later.
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
129 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
130 ;; Note that `ebnf-eps-buffer' and `ebnf-eps-region' never spool the EPS image,
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
131 ;; so they don't use the ps-print spooling mechanism. See section "Actions in
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
132 ;; Comments" for an explanation about EPS file generation.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
133 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
134 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
135 ;; Invoking Ebnf2ps
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
136 ;; ----------------
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
137 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
138 ;; To translate and print your buffer, type
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
139 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
140 ;; M-x ebnf-print-buffer
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
141 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
142 ;; or substitute one of the other four ebnf- commands. The command will
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
143 ;; generate the PostScript image and print or spool it as specified. By giving
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
144 ;; the command a prefix argument
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
145 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
146 ;; C-u M-x ebnf-print-buffer
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
147 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
148 ;; it will save the PostScript image to a file instead of sending it to the
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
149 ;; printer; you will be prompted for the name of the file to save the image to.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
150 ;; The prefix argument is ignored by the commands that spool their images, but
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
151 ;; you may save the spooled images to a file by giving a prefix argument to
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
152 ;; `ebnf-despool':
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
153 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
154 ;; C-u M-x ebnf-despool
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
155 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
156 ;; When invoked this way, `ebnf-despool' will prompt you for the name of the
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
157 ;; file to save to.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
158 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
159 ;; The prefix argument is also ignored by `ebnf-eps-buffer' and
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
160 ;; `ebnf-eps-region'.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
161 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
162 ;; Any of the `ebnf-' commands can be bound to keys. Here are some examples:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
163 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
164 ;; (global-set-key 'f22 'ebnf-print-buffer) ;f22 is prsc
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
165 ;; (global-set-key '(shift f22) 'ebnf-print-region)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
166 ;; (global-set-key '(control f22) 'ebnf-despool)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
167 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
168 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
169 ;; EBNF Syntax
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
170 ;; -----------
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
171 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
172 ;; The current EBNF that ebnf2ps accepts has the following constructions:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
173 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
174 ;; ; comment (until end of line)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
175 ;; A non-terminal
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
176 ;; "C" terminal
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
177 ;; ?C? special
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
178 ;; $A default non-terminal (see text below)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
179 ;; $"C" default terminal (see text below)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
180 ;; $?C? default special (see text below)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
181 ;; A = B. production (A is the header and B the body)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
182 ;; C D sequence (C occurs before D)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
183 ;; C | D alternative (C or D occurs)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
184 ;; A - B exception (A excluding B, B without any non-terminal)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
185 ;; n * A repetition (A repeats n (integer) times)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
186 ;; (C) group (expression C is grouped together)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
187 ;; [C] optional (C may or not occurs)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
188 ;; C+ one or more occurrences of C
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
189 ;; {C}+ one or more occurrences of C
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
190 ;; {C}* zero or more occurrences of C
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
191 ;; {C} zero or more occurrences of C
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
192 ;; C / D equivalent to: C {D C}*
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
193 ;; {C || D}+ equivalent to: C {D C}*
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
194 ;; {C || D}* equivalent to: [C {D C}*]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
195 ;; {C || D} equivalent to: [C {D C}*]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
196 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
197 ;; The EBNF syntax written using the notation above is:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
198 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
199 ;; EBNF = {production}+.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
200 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
201 ;; production = non_terminal "=" body ".". ;; production
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
202 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
203 ;; body = {sequence || "|"}*. ;; alternative
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
204 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
205 ;; sequence = {exception}*. ;; sequence
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
206 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
207 ;; exception = repeat [ "-" repeat]. ;; exception
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
208 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
209 ;; repeat = [ integer "*" ] term. ;; repetition
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
210 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
211 ;; term = factor
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
212 ;; | [factor] "+" ;; one-or-more
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
213 ;; | [factor] "/" [factor] ;; one-or-more
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
214 ;; .
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
215 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
216 ;; factor = [ "$" ] "\"" terminal "\"" ;; terminal
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
217 ;; | [ "$" ] non_terminal ;; non-terminal
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
218 ;; | [ "$" ] "?" special "?" ;; special
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
219 ;; | "(" body ")" ;; group
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
220 ;; | "[" body "]" ;; zero-or-one
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
221 ;; | "{" body [ "||" body ] "}+" ;; one-or-more
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
222 ;; | "{" body [ "||" body ] "}*" ;; zero-or-more
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
223 ;; | "{" body [ "||" body ] "}" ;; zero-or-more
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
224 ;; .
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
225 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
226 ;; non_terminal = "[A-Za-z\\240-\\377][!#%&'*-,0-:<>@-Z\\^-z~\\240-\\377]*".
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
227 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
228 ;; terminal = "\\([^\"\\]\\|\\\\[ -~\\240-\\377]\\)+".
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
229 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
230 ;; special = "[^?\\n\\000-\\010\\016-\\037\\177-\\237]*".
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
231 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
232 ;; integer = "[0-9]+".
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
233 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
234 ;; comment = ";" "[^\\n\\000-\\010\\016-\\037\\177-\\237]*" "\\n".
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
235 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
236 ;; Try to use the above EBNF to test ebnf2ps.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
237 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
238 ;; The `default' terminal, non-terminal and special is a way to indicate a
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
239 ;; default path in a production. For example, the production:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
240 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
241 ;; X = [ $A ( B | $C ) | D ].
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
242 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
243 ;; Indicates that the default meaning for "X" is "A C" if "X" is empty.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
244 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
245 ;; The terminal name is controlled by `ebnf-terminal-regexp' and
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
246 ;; `ebnf-case-fold-search', so it's possible to match other kind of terminal
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
247 ;; name besides that enclosed by `"'.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
248 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
249 ;; Let's see an example:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
250 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
251 ;; (setq ebnf-terminal-regexp "[A-Z][_A-Z]*") ; upper case name
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
252 ;; (setq ebnf-case-fold-search nil) ; exact matching
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
253 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
254 ;; If you have the production:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
255 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
256 ;; Logical = "(" Expression ( OR | AND | "XOR" ) Expression ")".
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
257 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
258 ;; The names are classified as:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
259 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
260 ;; Logical Expression non-terminal
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
261 ;; "(" OR AND "XOR" ")" terminal
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
262 ;;
30552
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
263 ;; The line comment is controlled by `ebnf-lex-comment-char'. The default
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
264 ;; value is ?\; (character `;').
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
265 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
266 ;; The end of production is controlled by `ebnf-lex-eop-char'. The default
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
267 ;; value is ?. (character `.').
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
268 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
269 ;; The variable `ebnf-syntax' specifies which syntax to recognize:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
270 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
271 ;; `ebnf' ebnf2ps recognizes the syntax described above.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
272 ;; The following variables *ONLY* have effect with this
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
273 ;; setting:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
274 ;; `ebnf-terminal-regexp', `ebnf-case-fold-search',
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
275 ;; `ebnf-lex-comment-char' and `ebnf-lex-eop-char'.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
276 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
277 ;; `iso-ebnf' ebnf2ps recognizes the syntax described in the URL:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
278 ;; `http://www.cl.cam.ac.uk/~mgk25/iso-ebnf.html'
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
279 ;; ("International Standard of the ISO EBNF Notation").
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
280 ;; The following variables *ONLY* have effect with this
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
281 ;; setting:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
282 ;; `ebnf-iso-alternative-p' and `ebnf-iso-normalize-p'.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
283 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
284 ;; `yacc' ebnf2ps recognizes the Yacc/Bison syntax.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
285 ;; The following variable *ONLY* has effect with this
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
286 ;; setting:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
287 ;; `ebnf-yac-ignore-error-recovery'.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
288 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
289 ;; Any other value is treated as `ebnf'.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
290 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
291 ;; The default value is `ebnf'.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
292 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
293 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
294 ;; Optimizations
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
295 ;; -------------
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
296 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
297 ;; The following EBNF optimizations are done:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
298 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
299 ;; [ { A }* ] ==> { A }*
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
300 ;; [ { A }+ ] ==> { A }*
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
301 ;; [ A ] + ==> { A }*
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
302 ;; { A }* + ==> { A }*
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
303 ;; { A }+ + ==> { A }+
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
304 ;; { A }- ==> { A }+
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
305 ;; [ A ]- ==> A
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
306 ;; ( A | EMPTY )- ==> A
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
307 ;; ( A | B | EMPTY )- ==> A | B
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
308 ;; [ A | B ] ==> A | B | EMPTY
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
309 ;; n * EMPTY ==> EMPTY
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
310 ;; EMPTY + ==> EMPTY
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
311 ;; EMPTY / EMPTY ==> EMPTY
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
312 ;; EMPTY - A ==> EMPTY
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
313 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
314 ;; The following optimizations are done when `ebnf-optimize' is non-nil:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
315 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
316 ;; left recursion:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
317 ;; 1. A = B | A C. ==> A = B {C}*.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
318 ;; 2. A = B | A B. ==> A = {B}+.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
319 ;; 3. A = | A B. ==> A = {B}*.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
320 ;; 4. A = B | A C B. ==> A = {B || C}+.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
321 ;; 5. A = B | D | A C | A E. ==> A = ( B | D ) { C | E }*.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
322 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
323 ;; optional:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
324 ;; 6. A = B | . ==> A = [B].
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
325 ;; 7. A = | B . ==> A = [B].
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
326 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
327 ;; factoration:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
328 ;; 8. A = B C | B D. ==> A = B (C | D).
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
329 ;; 9. A = C B | D B. ==> A = (C | D) B.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
330 ;; 10. A = B C E | B D E. ==> A = B (C | D) E.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
331 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
332 ;; The above optimizations are specially useful when `ebnf-syntax' is `yacc'.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
333 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
334 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
335 ;; Form Feed
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
336 ;; ---------
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
337 ;;
30552
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
338 ;; You may use form feed (^L \014) to force a production to start on a new
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
339 ;; page, for example:
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
340 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
341 ;; a) A = B | C.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
342 ;; ^L
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
343 ;; X = Y | Z.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
344 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
345 ;; b) A = B ^L | C.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
346 ;; X = Y | Z.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
347 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
348 ;; c) A = B ^L^L^L | C.^L
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
349 ;; ^L
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
350 ;; X = Y | Z.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
351 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
352 ;; In all examples above, only the production X will start on a new page.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
353 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
354 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
355 ;; Actions in Comments
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
356 ;; -------------------
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
357 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
358 ;; ebnf2ps accepts the following actions in comments:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
359 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
360 ;; ;> the next production starts in the same line as the current one.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
361 ;; It is useful when `ebnf-horizontal-orientation' is nil.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
362 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
363 ;; ;< the next production starts in the next line.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
364 ;; It is useful when `ebnf-horizontal-orientation' is non-nil.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
365 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
366 ;; ;[EPS open a new EPS file. The EPS file name has the form:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
367 ;; <PREFIX><NAME>.eps
30552
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
368 ;; where <PREFIX> is given by variable `ebnf-eps-prefix' and
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
369 ;; <NAME> is the string given by ;[ action comment, this string is
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
370 ;; mapped to form a valid file name (see documentation for
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
371 ;; `ebnf-eps-buffer' or `ebnf-eps-region').
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
372 ;; It has effect only during `ebnf-eps-buffer' or
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
373 ;; `ebnf-eps-region' execution.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
374 ;; It's an error to try to open an already opened EPS file.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
375 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
376 ;; ;]EPS close an opened EPS file.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
377 ;; It has effect only during `ebnf-eps-buffer' or
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
378 ;; `ebnf-eps-region' execution.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
379 ;; It's an error to try to close a not opened EPS file.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
380 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
381 ;; So if you have:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
382 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
383 ;; (setq ebnf-horizontal-orientation nil)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
384 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
385 ;; A = t.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
386 ;; C = x.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
387 ;; ;> C and B are drawn in the same line
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
388 ;; B = y.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
389 ;; W = v.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
390 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
391 ;; The graphical result is:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
392 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
393 ;; +---+
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
394 ;; | A |
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
395 ;; +---+
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
396 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
397 ;; +---------+ +-----+
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
398 ;; | | | |
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
399 ;; | C | | |
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
400 ;; | | | B |
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
401 ;; +---------+ | |
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
402 ;; | |
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
403 ;; +-----+
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
404 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
405 ;; +-----------+
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
406 ;; | W |
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
407 ;; +-----------+
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
408 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
409 ;; Note that if ascending production sort is used, the productions A and B will
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
410 ;; be drawn in the same line instead of C and B.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
411 ;;
30552
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
412 ;; If consecutive actions occur, only the last one takes effect, so if you
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
413 ;; have:
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
414 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
415 ;; A = X.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
416 ;; ;<
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
417 ;; ^L
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
418 ;; ;>
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
419 ;; B = Y.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
420 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
421 ;; Only the ;> will take effect, that is, A and B will be drawn in the same
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
422 ;; line.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
423 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
424 ;; In ISO EBNF the above actions are specified as (*>*), (*<*), (*[EPS*) and
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
425 ;; (*]EPS*). The first example above should be written:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
426 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
427 ;; A = t;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
428 ;; C = x;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
429 ;; (*> C and B are drawn in the same line *)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
430 ;; B = y;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
431 ;; W = v;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
432 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
433 ;; For an example of EPS action when executing `ebnf-eps-buffer' or
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
434 ;; `ebnf-eps-region':
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
435 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
436 ;; Z = B0.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
437 ;; ;[CC
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
438 ;; ;[AA
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
439 ;; A = B1.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
440 ;; ;[BB
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
441 ;; C = B2.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
442 ;; ;]AA
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
443 ;; B = B3.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
444 ;; ;]BB
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
445 ;; ;]CC
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
446 ;; D = B4.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
447 ;; E = B5.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
448 ;; ;[CC
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
449 ;; F = B6.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
450 ;; ;]CC
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
451 ;; G = B7.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
452 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
453 ;; The following table summarizes the results:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
454 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
455 ;; EPS FILE NAME NO SORT ASCENDING SORT DESCENDING SORT
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
456 ;; ebnf--AA.eps A C A C C A
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
457 ;; ebnf--BB.eps C B B C C B
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
458 ;; ebnf--CC.eps A C B F A B C F F C B A
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
459 ;; ebnf--D.eps D D D
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
460 ;; ebnf--E.eps E E E
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
461 ;; ebnf--G.eps G G G
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
462 ;; ebnf--Z.eps Z Z Z
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
463 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
464 ;; As you can see if EPS actions is not used, each single production is
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
465 ;; generated per EPS file. To avoid overriding EPS files, use names in ;[ that
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
466 ;; it's not an existing production name.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
467 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
468 ;; In the following case:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
469 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
470 ;; A = B0.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
471 ;; ;[AA
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
472 ;; A = B1.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
473 ;; ;[BB
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
474 ;; A = B2.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
475 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
476 ;; The production A is generated in both files ebnf--AA.eps and ebnf--BB.eps.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
477 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
478 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
479 ;; Utilities
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
480 ;; ---------
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
481 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
482 ;; Some tools are provided to help you.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
483 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
484 ;; `ebnf-setup' returns the current setup.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
485 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
486 ;; `ebnf-syntax-buffer' does a syntatic analysis of your EBNF in the current
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
487 ;; buffer.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
488 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
489 ;; `ebnf-syntax-region' does a syntatic analysis of your EBNF in the current
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
490 ;; region.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
491 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
492 ;; `ebnf-customize' activates a customization buffer for ebnf2ps options.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
493 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
494 ;; `ebnf-syntax-buffer', `ebnf-syntax-region' and `ebnf-customize' can be bound
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
495 ;; to keys in the same way as `ebnf-' commands.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
496 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
497 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
498 ;; Hooks
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
499 ;; -----
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
500 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
501 ;; ebn2ps has the following hook variables:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
502 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
503 ;; `ebnf-hook'
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
504 ;; It is evaluated once before any ebnf2ps process.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
505 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
506 ;; `ebnf-production-hook'
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
507 ;; It is evaluated on each beginning of production.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
508 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
509 ;; `ebnf-page-hook'
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
510 ;; It is evaluated on each beginning of page.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
511 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
512 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
513 ;; Options
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
514 ;; -------
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
515 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
516 ;; Below it's shown a brief description of ebnf2ps options, please, see the
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
517 ;; options declaration in the code for a long documentation.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
518 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
519 ;; `ebnf-horizontal-orientation' Non-nil means productions are drawn
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
520 ;; horizontally.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
521 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
522 ;; `ebnf-horizontal-max-height' Non-nil means to use maximum production
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
523 ;; height in horizontal orientation.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
524 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
525 ;; `ebnf-production-horizontal-space' Specify horizontal space in points
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
526 ;; between productions.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
527 ;;
30552
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
528 ;; `ebnf-production-vertical-space' Specify vertical space in points
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
529 ;; between productions.
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
530 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
531 ;; `ebnf-justify-sequence' Specify justification of terms in a
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
532 ;; sequence inside alternatives.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
533 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
534 ;; `ebnf-terminal-regexp' Specify how it's a terminal name.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
535 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
536 ;; `ebnf-case-fold-search' Non-nil means ignore case on matching.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
537 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
538 ;; `ebnf-terminal-font' Specify terminal font.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
539 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
540 ;; `ebnf-terminal-shape' Specify terminal box shape.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
541 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
542 ;; `ebnf-terminal-shadow' Non-nil means terminal box will have a
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
543 ;; shadow.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
544 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
545 ;; `ebnf-terminal-border-width' Specify border width for terminal box.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
546 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
547 ;; `ebnf-terminal-border-color' Specify border color for terminal box.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
548 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
549 ;; `ebnf-sort-production' Specify how productions are sorted.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
550 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
551 ;; `ebnf-production-font' Specify production font.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
552 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
553 ;; `ebnf-non-terminal-font' Specify non-terminal font.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
554 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
555 ;; `ebnf-non-terminal-shape' Specify non-terminal box shape.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
556 ;;
30552
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
557 ;; `ebnf-non-terminal-shadow' Non-nil means non-terminal box will
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
558 ;; have a shadow.
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
559 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
560 ;; `ebnf-non-terminal-border-width' Specify border width for non-terminal
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
561 ;; box.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
562 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
563 ;; `ebnf-non-terminal-border-color' Specify border color for non-terminal
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
564 ;; box.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
565 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
566 ;; `ebnf-special-font' Specify special font.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
567 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
568 ;; `ebnf-special-shape' Specify special box shape.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
569 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
570 ;; `ebnf-special-shadow' Non-nil means special box will have a
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
571 ;; shadow.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
572 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
573 ;; `ebnf-special-border-width' Specify border width for special box.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
574 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
575 ;; `ebnf-special-border-color' Specify border color for special box.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
576 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
577 ;; `ebnf-except-font' Specify except font.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
578 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
579 ;; `ebnf-except-shape' Specify except box shape.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
580 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
581 ;; `ebnf-except-shadow' Non-nil means except box will have a
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
582 ;; shadow.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
583 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
584 ;; `ebnf-except-border-width' Specify border width for except box.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
585 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
586 ;; `ebnf-except-border-color' Specify border color for except box.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
587 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
588 ;; `ebnf-repeat-font' Specify repeat font.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
589 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
590 ;; `ebnf-repeat-shape' Specify repeat box shape.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
591 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
592 ;; `ebnf-repeat-shadow' Non-nil means repeat box will have a
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
593 ;; shadow.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
594 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
595 ;; `ebnf-repeat-border-width' Specify border width for repeat box.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
596 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
597 ;; `ebnf-repeat-border-color' Specify border color for repeat box.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
598 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
599 ;; `ebnf-entry-percentage' Specify entry height on alternatives.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
600 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
601 ;; `ebnf-arrow-shape' Specify the arrow shape.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
602 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
603 ;; `ebnf-chart-shape' Specify chart flow shape.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
604 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
605 ;; `ebnf-color-p' Non-nil means use color.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
606 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
607 ;; `ebnf-line-width' Specify flow line width.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
608 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
609 ;; `ebnf-line-color' Specify flow line color.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
610 ;;
31255
81113bfa57a5 Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30572
diff changeset
611 ;; `ebnf-user-arrow' Specify a sexp for user arrow shape (a
30552
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
612 ;; PostScript code).
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
613 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
614 ;; `ebnf-debug-ps' Non-nil means to generate PostScript
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
615 ;; debug procedures.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
616 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
617 ;; `ebnf-lex-comment-char' Specify the line comment character.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
618 ;;
30552
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
619 ;; `ebnf-lex-eop-char' Specify the end of production
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
620 ;; character.
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
621 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
622 ;; `ebnf-syntax' Specify syntax to be recognized.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
623 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
624 ;; `ebnf-iso-alternative-p' Non-nil means use alternative ISO EBNF.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
625 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
626 ;; `ebnf-iso-normalize-p' Non-nil means normalize ISO EBNF syntax
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
627 ;; names.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
628 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
629 ;; `ebnf-default-width' Specify additional border width over
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
630 ;; default terminal, non-terminal or
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
631 ;; special.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
632 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
633 ;; `ebnf-eps-prefix' Specify EPS prefix file name.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
634 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
635 ;; `ebnf-use-float-format' Non-nil means use `%f' float format.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
636 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
637 ;; `ebnf-yac-ignore-error-recovery' Non-nil means ignore error recovery.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
638 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
639 ;; `ebnf-ignore-empty-rule' Non-nil means ignore empty rules.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
640 ;;
30552
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
641 ;; `ebnf-optimize' Non-nil means optimize syntatic chart
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
642 ;; of rules.
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
643 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
644 ;; To set the above options you may:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
645 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
646 ;; a) insert the code in your ~/.emacs, like:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
647 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
648 ;; (setq ebnf-terminal-shape 'bevel)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
649 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
650 ;; This way always keep your default settings when you enter a new Emacs
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
651 ;; session.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
652 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
653 ;; b) or use `set-variable' in your Emacs session, like:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
654 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
655 ;; M-x set-variable RET ebnf-terminal-shape RET bevel RET
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
656 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
657 ;; This way keep your settings only during the current Emacs session.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
658 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
659 ;; c) or use customization, for example:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
660 ;; click on menu-bar *Help* option,
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
661 ;; then click on *Customize*,
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
662 ;; then click on *Browse Customization Groups*,
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
663 ;; expand *PostScript* group,
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
664 ;; expand *Ebnf2ps* group
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
665 ;; and then customize ebnf2ps options.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
666 ;; Through this way, you may choose if the settings are kept or not when
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
667 ;; you leave out the current Emacs session.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
668 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
669 ;; d) or see the option value:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
670 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
671 ;; C-h v ebnf-terminal-shape RET
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
672 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
673 ;; and click the *customize* hypertext button.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
674 ;; Through this way, you may choose if the settings are kept or not when
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
675 ;; you leave out the current Emacs session.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
676 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
677 ;; e) or invoke:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
678 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
679 ;; M-x ebnf-customize RET
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
680 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
681 ;; and then customize ebnf2ps options.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
682 ;; Through this way, you may choose if the settings are kept or not when
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
683 ;; you leave out the current Emacs session.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
684 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
685 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
686 ;; Styles
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
687 ;; ------
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
688 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
689 ;; Sometimes you need to change the EBNF style you are using, for example,
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
690 ;; change the shapes and colors. These changes may force you to set some
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
691 ;; variables and after use, set back the variables to the old values.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
692 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
693 ;; To help to handle this situation, ebnf2ps has the following commands to
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
694 ;; handle styles:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
695 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
696 ;; `ebnf-insert-style' Insert a new style NAME with inheritance INHERITS and
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
697 ;; values VALUES.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
698 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
699 ;; `ebnf-merge-style' Merge values of style NAME with style VALUES.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
700 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
701 ;; `ebnf-apply-style' Set STYLE to current style.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
702 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
703 ;; `ebnf-reset-style' Reset current style.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
704 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
705 ;; `ebnf-push-style' Push the current style and set STYLE to current style.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
706 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
707 ;; `ebnf-pop-style' Pop a style and set it to current style.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
708 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
709 ;; These commands helps to put together a lot of variable settings in a group
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
710 ;; and name this group. So when you wish to apply these settings it's only
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
711 ;; needed to give the name.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
712 ;;
30552
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
713 ;; There is also a notion of simple inheritance of style; so if you declare
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
714 ;; that a style A inherits from a style B, all settings of B is applied first
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
715 ;; and then the settings of A is applied. This is useful when you wish to
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
716 ;; modify some aspects of an existing style, but at same time wish to keep it
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
717 ;; unmodified.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
718 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
719 ;; See documentation for `ebnf-style-database'.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
720 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
721 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
722 ;; Layout
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
723 ;; ------
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
724 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
725 ;; Below it is the layout of minimum area to draw each element, and it's used
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
726 ;; the following terms:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
727 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
728 ;; font height is given by:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
729 ;; (terminal font height + non-terminal font height) / 2
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
730 ;;
30552
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
731 ;; entry is the vertical position used to know where it should
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
732 ;; be drawn the flow line in the current element.
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
733 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
734 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
735 ;; * SPECIAL, TERMINAL and NON-TERMINAL
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
736 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
737 ;; +==============+...................................
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
738 ;; | | } font height / 2 } entry }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
739 ;; | XXXXXXXX...|....... } }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
740 ;; ====+ XXXXXXXX +==== } text height ...... } height
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
741 ;; : | XXXXXXXX...|...:... }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
742 ;; : | : : | : } font height / 2 }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
743 ;; : +==============+...:...............................
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
744 ;; : : : : : :
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
745 ;; : : : : : :......................
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
746 ;; : : : : : } font height }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
747 ;; : : : : :....... }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
748 ;; : : : : } font height / 2 }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
749 ;; : : : :........... }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
750 ;; : : : } text width } width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
751 ;; : : :.................. }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
752 ;; : : } font height / 2 }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
753 ;; : :...................... }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
754 ;; : } font height }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
755 ;; :.............................................
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
756 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
757 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
758 ;; * OPTIONAL
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
759 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
760 ;; +==========+.....................................
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
761 ;; | | } } }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
762 ;; | | } entry } }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
763 ;; | | } } }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
764 ;; ===+===+ +===+===... } element height } height
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
765 ;; : \ | | / : } }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
766 ;; : + | | + : } }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
767 ;; : | +==========+.|................. }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
768 ;; : | : : | : } font height }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
769 ;; : +==============+...................................
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
770 ;; : : : :
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
771 ;; : : : :......................
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
772 ;; : : : } font height * 2 }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
773 ;; : : :.......... }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
774 ;; : : } element width } width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
775 ;; : :..................... }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
776 ;; : } font height * 2 }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
777 ;; :...............................................
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
778 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
779 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
780 ;; * ALTERNATIVE
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
781 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
782 ;; +===+...................................
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
783 ;; +==+ A +==+ } A height } }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
784 ;; | +===+..|........ } entry }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
785 ;; + + } font height } }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
786 ;; / +===+...\....... } }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
787 ;; ===+====+ B +====+=== } B height ..... } height
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
788 ;; : \ +===+.../....... }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
789 ;; : + + : } font height }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
790 ;; : | +===+..|........ }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
791 ;; : +==+ C +==+ : } C height }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
792 ;; : : +===+...................................
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
793 ;; : : : :
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
794 ;; : : : :......................
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
795 ;; : : : } font height * 2 }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
796 ;; : : :......... }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
797 ;; : : } max width } width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
798 ;; : :................. }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
799 ;; : } font height * 2 }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
800 ;; :..........................................
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
801 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
802 ;; NOTES:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
803 ;; 1. An empty alternative has zero of height.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
804 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
805 ;; 2. The variable `ebnf-entry-percentage' is used to determine the
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
806 ;; entry point.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
807 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
808 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
809 ;; * ZERO OR MORE
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
810 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
811 ;; +===========+...............................
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
812 ;; +=+ separator +=+ } separator height }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
813 ;; / +===========+..\........ }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
814 ;; + + } }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
815 ;; | | } font height }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
816 ;; + + } }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
817 ;; \ +===========+../........ } height = entry
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
818 ;; +=+ element +=+ } element height }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
819 ;; /: +===========+..\........ }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
820 ;; + : : + } }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
821 ;; + : : + } font height }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
822 ;; / : : \ } }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
823 ;; ==+=======================+==.......................
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
824 ;; : : : :
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
825 ;; : : : :.......................
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
826 ;; : : : } font height * 2 }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
827 ;; : : :......... }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
828 ;; : : } max width } width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
829 ;; : :......................... }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
830 ;; : } font height * 2 }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
831 ;; :...................................................
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
832 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
833 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
834 ;; * ONE OR MORE
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
835 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
836 ;; +===========+......................................
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
837 ;; +=+ separator +=+ } separator height } }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
838 ;; / +===========+..\...... } }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
839 ;; + + } } entry }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
840 ;; | | } font height } } height
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
841 ;; + + } } }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
842 ;; \ +===========+../...... } }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
843 ;; ===+=+ element +=+=== } element height .... }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
844 ;; : : +===========+......................................
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
845 ;; : : : :
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
846 ;; : : : :........................
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
847 ;; : : : } font height * 2 }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
848 ;; : : :....... }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
849 ;; : : } max width } width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
850 ;; : :....................... }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
851 ;; : } font height * 2 }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
852 ;; :..............................................
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
853 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
854 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
855 ;; * PRODUCTION
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
856 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
857 ;; XXXXXX:......................................
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
858 ;; XXXXXX: } production font height }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
859 ;; XXXXXX:............ }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
860 ;; } font height }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
861 ;; +======+....... } height = entry
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
862 ;; | | } }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
863 ;; ====+ +==== } element height }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
864 ;; : | | : } }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
865 ;; : +======+.................................
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
866 ;; : : : :
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
867 ;; : : : :......................
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
868 ;; : : : } font height * 2 }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
869 ;; : : :....... }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
870 ;; : : } element width } width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
871 ;; : :.............. }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
872 ;; : } font height * 2 }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
873 ;; :.....................................
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
874 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
875 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
876 ;; * REPEAT
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
877 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
878 ;; +================+...................................
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
879 ;; | | } font height / 2 } entry }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
880 ;; | +===+...|....... } }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
881 ;; ====+ N * | X | +==== } X height ......... } height
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
882 ;; : | : : +===+...|...:... }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
883 ;; : | : : : : | : } font height / 2 }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
884 ;; : +================+...:...............................
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
885 ;; : : : : : : : :
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
886 ;; : : : : : : : :......................
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
887 ;; : : : : : : : } font height }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
888 ;; : : : : : : :....... }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
889 ;; : : : : : : } font height / 2 }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
890 ;; : : : : : :........... }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
891 ;; : : : : : } X width }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
892 ;; : : : : :............... }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
893 ;; : : : : } font height / 2 } width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
894 ;; : : : :.................. }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
895 ;; : : : } text width }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
896 ;; : : :..................... }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
897 ;; : : } font height / 2 }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
898 ;; : :........................ }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
899 ;; : } font height }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
900 ;; :...............................................
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
901 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
902 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
903 ;; * EXCEPT
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
904 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
905 ;; +==================+...................................
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
906 ;; | | } font height / 2 } entry }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
907 ;; | +===+ +===+...|....... } }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
908 ;; ====+ | X | - | y | +==== } max height ....... } height
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
909 ;; : | +===+ +===+...|...:... }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
910 ;; : | : : : : | : } font height / 2 }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
911 ;; : +==================+...:...............................
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
912 ;; : : : : : : : :
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
913 ;; : : : : : : : :......................
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
914 ;; : : : : : : : } font height }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
915 ;; : : : : : : :....... }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
916 ;; : : : : : : } font height / 2 }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
917 ;; : : : : : :........... }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
918 ;; : : : : : } Y width }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
919 ;; : : : : :............... }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
920 ;; : : : : } font height } width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
921 ;; : : : :................... }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
922 ;; : : : } X width }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
923 ;; : : :....................... }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
924 ;; : : } font height / 2 }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
925 ;; : :.......................... }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
926 ;; : } font height }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
927 ;; :.................................................
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
928 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
929 ;; NOTE: If Y element is empty, it's draw nothing at Y place.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
930 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
931 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
932 ;; Internal Structures
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
933 ;; -------------------
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
934 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
935 ;; ebnf2ps has two passes. The first pass does a lexical and syntatic analysis
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
936 ;; of current buffer and generates an intermediate representation. The second
30552
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
937 ;; pass uses the intermediate representation to generate the PostScript
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
938 ;; syntatic chart.
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
939 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
940 ;; The intermediate representation is a list of vectors, the vector element
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
941 ;; represents a syntatic chart element. Below is a vector representation for
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
942 ;; each syntatic chart element.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
943 ;;
30552
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
944 ;; [production WIDTH-FUN DIM-FUN ENTRY HEIGHT WIDTH NAME PRODUCTION ACTION]
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
945 ;; [alternative WIDTH-FUN DIM-FUN ENTRY HEIGHT WIDTH LIST]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
946 ;; [sequence WIDTH-FUN DIM-FUN ENTRY HEIGHT WIDTH LIST]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
947 ;; [terminal WIDTH-FUN DIM-FUN ENTRY HEIGHT WIDTH NAME DEFAULT]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
948 ;; [non-terminal WIDTH-FUN DIM-FUN ENTRY HEIGHT WIDTH NAME DEFAULT]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
949 ;; [special WIDTH-FUN DIM-FUN ENTRY HEIGHT WIDTH NAME DEFAULT]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
950 ;; [empty WIDTH-FUN DIM-FUN ENTRY HEIGHT WIDTH]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
951 ;; [optional WIDTH-FUN DIM-FUN ENTRY HEIGHT WIDTH ELEMENT]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
952 ;; [one-or-more WIDTH-FUN DIM-FUN ENTRY HEIGHT WIDTH ELEMENT SEPARATOR]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
953 ;; [zero-or-more WIDTH-FUN DIM-FUN ENTRY HEIGHT WIDTH ELEMENT SEPARATOR]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
954 ;; [repeat WIDTH-FUN DIM-FUN ENTRY HEIGHT WIDTH TIMES ELEMENT]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
955 ;; [except WIDTH-FUN DIM-FUN ENTRY HEIGHT WIDTH ELEMENT ELEMENT]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
956 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
957 ;; The first vector position is a function symbol used to generate PostScript
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
958 ;; for this element.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
959 ;; WIDTH-FUN is a function symbol called to adjust the element width.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
960 ;; DIM-FUN is a function symbol called to set the element dimensions.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
961 ;; ENTRY is the element entry point.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
962 ;; HEIGHT and WIDTH are the element height and width, respectively.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
963 ;; NAME is a string that it's the element name.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
964 ;; DEFAULT is a boolean that indicates if it's a `default' element.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
965 ;; PRODUCTION and ELEMENT are vectors that represents sub-elements of current
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
966 ;; one.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
967 ;; LIST is a list of vector that represents the list part for alternatives and
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
968 ;; sequences.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
969 ;; SEPARATOR is a vector that represents the sub-element used to separate the
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
970 ;; list elements.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
971 ;; TIMES is a string representing the number of times that ELEMENT is repeated
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
972 ;; on a repeat construction.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
973 ;; ACTION indicates some action that should be done before production is
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
974 ;; generated. The current actions are:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
975 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
976 ;; nil no action.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
977 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
978 ;; form-feed current production starts on a new page.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
979 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
980 ;; newline current production starts on next line, this is useful
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
981 ;; when `ebnf-horizontal-orientation' is non-nil.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
982 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
983 ;; keep-line current production continues on the current line, this
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
984 ;; is useful when `ebnf-horizontal-orientation' is nil.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
985 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
986 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
987 ;; Things To Change
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
988 ;; ----------------
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
989 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
990 ;; . Handle situations when syntatic chart is out of paper.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
991 ;; . Use other alphabet than ascii.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
992 ;; . Optimizations...
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
993 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
994 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
995 ;; Acknowledgements
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
996 ;; ----------------
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
997 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
998 ;; Thanks to all who emailed comments.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
999 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1000 ;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1001 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1002
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1003 ;;; code:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1004
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1005
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1006 (require 'ps-print)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1007
30552
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
1008 (and (string< ps-print-version "5.2.3")
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
1009 (error "`ebnf2ps' requires `ps-print' package version 5.2.3 or later"))
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1010
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1011
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1012 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1013 ;; User Variables:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1014
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1015
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1016 ;;; Interface to the command system
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1017
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1018 (defgroup postscript nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1019 "PostScript Group"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1020 :tag "PostScript"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1021 :group 'emacs)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1022
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1023
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1024 (defgroup ebnf2ps nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1025 "Translate an EBNF to a syntatic chart on PostScript"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1026 :prefix "ebnf-"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1027 :group 'wp
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1028 :group 'postscript)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1029
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1030
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1031 (defgroup ebnf-special nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1032 "Special customization"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1033 :prefix "ebnf-"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1034 :tag "Special"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1035 :group 'ebnf2ps)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1036
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1037
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1038 (defgroup ebnf-except nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1039 "Except customization"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1040 :prefix "ebnf-"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1041 :tag "Except"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1042 :group 'ebnf2ps)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1043
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1044
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1045 (defgroup ebnf-repeat nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1046 "Repeat customization"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1047 :prefix "ebnf-"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1048 :tag "Repeat"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1049 :group 'ebnf2ps)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1050
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1051
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1052 (defgroup ebnf-terminal nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1053 "Terminal customization"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1054 :prefix "ebnf-"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1055 :tag "Terminal"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1056 :group 'ebnf2ps)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1057
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1058
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1059 (defgroup ebnf-non-terminal nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1060 "Non-Terminal customization"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1061 :prefix "ebnf-"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1062 :tag "Non-Terminal"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1063 :group 'ebnf2ps)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1064
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1065
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1066 (defgroup ebnf-production nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1067 "Production customization"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1068 :prefix "ebnf-"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1069 :tag "Production"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1070 :group 'ebnf2ps)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1071
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1072
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1073 (defgroup ebnf-shape nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1074 "Shapes customization"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1075 :prefix "ebnf-"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1076 :tag "Shape"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1077 :group 'ebnf2ps)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1078
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1079
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1080 (defgroup ebnf-displacement nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1081 "Displacement customization"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1082 :prefix "ebnf-"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1083 :tag "Displacement"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1084 :group 'ebnf2ps)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1085
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1086
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1087 (defgroup ebnf-syntatic nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1088 "Syntatic customization"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1089 :prefix "ebnf-"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1090 :tag "Syntatic"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1091 :group 'ebnf2ps)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1092
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1093
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1094 (defgroup ebnf-optimization nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1095 "Optimization customization"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1096 :prefix "ebnf-"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1097 :tag "Optimization"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1098 :group 'ebnf2ps)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1099
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1100
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1101 (defcustom ebnf-horizontal-orientation nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1102 "*Non-nil means productions are drawn horizontally."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1103 :type 'boolean
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1104 :group 'ebnf-displacement)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1105
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1106
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1107 (defcustom ebnf-horizontal-max-height nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1108 "*Non-nil means to use maximum production height in horizontal orientation.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1109
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1110 It is only used when `ebnf-horizontal-orientation' is non-nil."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1111 :type 'boolean
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1112 :group 'ebnf-displacement)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1113
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1114
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1115 (defcustom ebnf-production-horizontal-space 0.0 ; use ebnf2ps default value
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1116 "*Specify horizontal space in points between productions.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1117
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1118 Value less or equal to zero forces ebnf2ps to set a proper default value."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1119 :type 'number
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1120 :group 'ebnf-displacement)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1121
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1122
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1123 (defcustom ebnf-production-vertical-space 0.0 ; use ebnf2ps default value
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1124 "*Specify vertical space in points between productions.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1125
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1126 Value less or equal to zero forces ebnf2ps to set a proper default value."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1127 :type 'number
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1128 :group 'ebnf-displacement)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1129
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1130
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1131 (defcustom ebnf-justify-sequence 'center
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1132 "*Specify justification of terms in a sequence inside alternatives.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1133
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1134 Valid values are:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1135
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1136 `left' left justification
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1137 `right' right justification
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1138 any other value centralize"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1139 :type '(radio :tag "Sequence Justification"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1140 (const left) (const right) (other :tag "center" center))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1141 :group 'ebnf-displacement)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1142
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1143
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1144 (defcustom ebnf-special-font '(7 Courier "Black" "Gray95" bold italic)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1145 "*Specify special font.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1146
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1147 See documentation for `ebnf-production-font'."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1148 :type '(list :tag "Special Font"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1149 (number :tag "Font Size")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1150 (symbol :tag "Font Name")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1151 (choice :tag "Foreground Color"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1152 (string :tag "Name")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1153 (other :tag "Default" nil))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1154 (choice :tag "Background Color"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1155 (string :tag "Name")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1156 (other :tag "Default" nil))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1157 (repeat :tag "Font Attributes" :inline t
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1158 (choice (const bold) (const italic)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1159 (const underline) (const strikeout)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1160 (const overline) (const shadow)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1161 (const box) (const outline))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1162 :group 'ebnf-special)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1163
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1164
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1165 (defcustom ebnf-special-shape 'bevel
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1166 "*Specify special box shape.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1167
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1168 See documentation for `ebnf-non-terminal-shape'."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1169 :type '(radio :tag "Special Shape"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1170 (const miter) (const round) (const bevel))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1171 :group 'ebnf-special)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1172
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1173
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1174 (defcustom ebnf-special-shadow nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1175 "*Non-nil means special box will have a shadow."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1176 :type 'boolean
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1177 :group 'ebnf-special)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1178
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1179
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1180 (defcustom ebnf-special-border-width 0.5
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1181 "*Specify border width for special box."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1182 :type 'number
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1183 :group 'ebnf-special)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1184
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1185
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1186 (defcustom ebnf-special-border-color "Black"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1187 "*Specify border color for special box."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1188 :type 'string
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1189 :group 'ebnf-special)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1190
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1191
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1192 (defcustom ebnf-except-font '(7 Courier "Black" "Gray90" bold italic)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1193 "*Specify except font.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1194
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1195 See documentation for `ebnf-production-font'."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1196 :type '(list :tag "Except Font"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1197 (number :tag "Font Size")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1198 (symbol :tag "Font Name")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1199 (choice :tag "Foreground Color"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1200 (string :tag "Name")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1201 (other :tag "Default" nil))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1202 (choice :tag "Background Color"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1203 (string :tag "Name")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1204 (other :tag "Default" nil))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1205 (repeat :tag "Font Attributes" :inline t
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1206 (choice (const bold) (const italic)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1207 (const underline) (const strikeout)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1208 (const overline) (const shadow)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1209 (const box) (const outline))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1210 :group 'ebnf-except)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1211
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1212
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1213 (defcustom ebnf-except-shape 'bevel
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1214 "*Specify except box shape.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1215
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1216 See documentation for `ebnf-non-terminal-shape'."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1217 :type '(radio :tag "Except Shape"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1218 (const miter) (const round) (const bevel))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1219 :group 'ebnf-except)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1220
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1221
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1222 (defcustom ebnf-except-shadow nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1223 "*Non-nil means except box will have a shadow."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1224 :type 'boolean
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1225 :group 'ebnf-except)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1226
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1227
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1228 (defcustom ebnf-except-border-width 0.25
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1229 "*Specify border width for except box."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1230 :type 'number
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1231 :group 'ebnf-except)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1232
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1233
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1234 (defcustom ebnf-except-border-color "Black"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1235 "*Specify border color for except box."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1236 :type 'string
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1237 :group 'ebnf-except)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1238
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1239
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1240 (defcustom ebnf-repeat-font '(7 Courier "Black" "Gray85" bold italic)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1241 "*Specify repeat font.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1242
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1243 See documentation for `ebnf-production-font'."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1244 :type '(list :tag "Repeat Font"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1245 (number :tag "Font Size")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1246 (symbol :tag "Font Name")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1247 (choice :tag "Foreground Color"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1248 (string :tag "Name")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1249 (other :tag "Default" nil))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1250 (choice :tag "Background Color"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1251 (string :tag "Name")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1252 (other :tag "Default" nil))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1253 (repeat :tag "Font Attributes" :inline t
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1254 (choice (const bold) (const italic)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1255 (const underline) (const strikeout)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1256 (const overline) (const shadow)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1257 (const box) (const outline))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1258 :group 'ebnf-repeat)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1259
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1260
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1261 (defcustom ebnf-repeat-shape 'bevel
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1262 "*Specify repeat box shape.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1263
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1264 See documentation for `ebnf-non-terminal-shape'."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1265 :type '(radio :tag "Repeat Shape"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1266 (const miter) (const round) (const bevel))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1267 :group 'ebnf-repeat)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1268
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1269
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1270 (defcustom ebnf-repeat-shadow nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1271 "*Non-nil means repeat box will have a shadow."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1272 :type 'boolean
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1273 :group 'ebnf-repeat)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1274
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1275
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1276 (defcustom ebnf-repeat-border-width 0.0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1277 "*Specify border width for repeat box."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1278 :type 'number
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1279 :group 'ebnf-repeat)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1280
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1281
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1282 (defcustom ebnf-repeat-border-color "Black"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1283 "*Specify border color for repeat box."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1284 :type 'string
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1285 :group 'ebnf-repeat)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1286
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1287
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1288 (defcustom ebnf-terminal-font '(7 Courier "Black" "White")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1289 "*Specify terminal font.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1290
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1291 See documentation for `ebnf-production-font'."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1292 :type '(list :tag "Terminal Font"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1293 (number :tag "Font Size")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1294 (symbol :tag "Font Name")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1295 (choice :tag "Foreground Color"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1296 (string :tag "Name")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1297 (other :tag "Default" nil))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1298 (choice :tag "Background Color"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1299 (string :tag "Name")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1300 (other :tag "Default" nil))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1301 (repeat :tag "Font Attributes" :inline t
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1302 (choice (const bold) (const italic)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1303 (const underline) (const strikeout)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1304 (const overline) (const shadow)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1305 (const box) (const outline))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1306 :group 'ebnf-terminal)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1307
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1308
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1309 (defcustom ebnf-terminal-shape 'miter
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1310 "*Specify terminal box shape.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1311
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1312 See documentation for `ebnf-non-terminal-shape'."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1313 :type '(radio :tag "Terminal Shape"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1314 (const miter) (const round) (const bevel))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1315 :group 'ebnf-terminal)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1316
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1317
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1318 (defcustom ebnf-terminal-shadow nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1319 "*Non-nil means terminal box will have a shadow."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1320 :type 'boolean
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1321 :group 'ebnf-terminal)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1322
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1323
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1324 (defcustom ebnf-terminal-border-width 1.0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1325 "*Specify border width for terminal box."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1326 :type 'number
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1327 :group 'ebnf-terminal)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1328
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1329
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1330 (defcustom ebnf-terminal-border-color "Black"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1331 "*Specify border color for terminal box."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1332 :type 'string
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1333 :group 'ebnf-terminal)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1334
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1335
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1336 (defcustom ebnf-sort-production nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1337 "*Specify how productions are sorted.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1338
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1339 Valid values are:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1340
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1341 nil don't sort productions.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1342 `ascending' ascending sort.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1343 any other value descending sort."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1344 :type '(radio :tag "Production Sort"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1345 (const :tag "Ascending" ascending)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1346 (const :tag "Descending" descending)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1347 (other :tag "No Sort" nil))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1348 :group 'ebnf-production)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1349
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1350
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1351 (defcustom ebnf-production-font '(10 Helvetica "Black" "White" bold)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1352 "*Specify production header font.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1353
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1354 It is a list with the following form:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1355
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1356 (SIZE NAME FOREGROUND BACKGROUND ATTRIBUTE...)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1357
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1358 Where:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1359 SIZE is the font size.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1360 NAME is the font name symbol.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1361 ATTRIBUTE is one of the following symbols:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1362 bold - use bold font.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1363 italic - use italic font.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1364 underline - put a line under text.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1365 strikeout - like underline, but the line is in middle of text.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1366 overline - like underline, but the line is over the text.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1367 shadow - text will have a shadow.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1368 box - text will be surrounded by a box.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1369 outline - print characters as hollow outlines.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1370 FOREGROUND is a foreground string color name; if it's nil, the default color is
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1371 \"Black\".
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1372 BACKGROUND is a background string color name; if it's nil, the default color is
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1373 \"White\".
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1374
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1375 See `ps-font-info-database' for valid font name."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1376 :type '(list :tag "Production Font"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1377 (number :tag "Font Size")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1378 (symbol :tag "Font Name")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1379 (choice :tag "Foreground Color"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1380 (string :tag "Name")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1381 (other :tag "Default" nil))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1382 (choice :tag "Background Color"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1383 (string :tag "Name")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1384 (other :tag "Default" nil))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1385 (repeat :tag "Font Attributes" :inline t
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1386 (choice (const bold) (const italic)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1387 (const underline) (const strikeout)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1388 (const overline) (const shadow)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1389 (const box) (const outline))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1390 :group 'ebnf-production)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1391
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1392
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1393 (defcustom ebnf-non-terminal-font '(7 Helvetica "Black" "White")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1394 "*Specify non-terminal font.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1395
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1396 See documentation for `ebnf-production-font'."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1397 :type '(list :tag "Non-Terminal Font"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1398 (number :tag "Font Size")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1399 (symbol :tag "Font Name")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1400 (choice :tag "Foreground Color"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1401 (string :tag "Name")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1402 (other :tag "Default" nil))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1403 (choice :tag "Background Color"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1404 (string :tag "Name")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1405 (other :tag "Default" nil))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1406 (repeat :tag "Font Attributes" :inline t
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1407 (choice (const bold) (const italic)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1408 (const underline) (const strikeout)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1409 (const overline) (const shadow)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1410 (const box) (const outline))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1411 :group 'ebnf-non-terminal)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1412
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1413
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1414 (defcustom ebnf-non-terminal-shape 'round
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1415 "*Specify non-terminal box shape.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1416
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1417 Valid values are:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1418
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1419 `miter' +-------+
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1420 | |
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1421 +-------+
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1422
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1423 `round' -------
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1424 ( )
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1425 -------
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1426
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1427 `bevel' /-------\\
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1428 | |
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1429 \\-------/
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1430
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1431 Any other value is treated as `miter'."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1432 :type '(radio :tag "Non-Terminal Shape"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1433 (const miter) (const round) (const bevel))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1434 :group 'ebnf-non-terminal)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1435
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1436
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1437 (defcustom ebnf-non-terminal-shadow nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1438 "*Non-nil means non-terminal box will have a shadow."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1439 :type 'boolean
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1440 :group 'ebnf-non-terminal)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1441
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1442
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1443 (defcustom ebnf-non-terminal-border-width 1.0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1444 "*Specify border width for non-terminal box."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1445 :type 'number
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1446 :group 'ebnf-non-terminal)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1447
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1448
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1449 (defcustom ebnf-non-terminal-border-color "Black"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1450 "*Specify border color for non-terminal box."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1451 :type 'string
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1452 :group 'ebnf-non-terminal)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1453
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1454
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1455 (defcustom ebnf-arrow-shape 'hollow
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1456 "*Specify the arrow shape.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1457
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1458 Valid values are:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1459
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1460 `none' ======
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1461
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1462 `semi-up' * `transparent' *
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1463 * |*
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1464 =====* | *
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1465 ==+==*
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1466 | *
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1467 |*
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1468 *
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1469
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1470 `semi-down' =====* `hollow' *
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1471 * |*
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1472 * | *
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1473 ==+ *
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1474 | *
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1475 |*
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1476 *
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1477
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1478 `simple' * `full' *
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1479 * |*
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1480 =====* |X*
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1481 * ==+XX*
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1482 * |X*
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1483 |*
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1484 *
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1485
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1486 `user' See also documentation for variable `ebnf-user-arrow'.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1487
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1488 Any other value is treated as `none'."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1489 :type '(radio :tag "Arrow Shape"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1490 (const none) (const semi-up)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1491 (const semi-down) (const simple)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1492 (const transparent) (const hollow)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1493 (const full) (const user))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1494 :group 'ebnf-shape)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1495
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1496
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1497 (defcustom ebnf-chart-shape 'round
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1498 "*Specify chart flow shape.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1499
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1500 See documentation for `ebnf-non-terminal-shape'."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1501 :type '(radio :tag "Chart Flow Shape"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1502 (const miter) (const round) (const bevel))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1503 :group 'ebnf-shape)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1504
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1505
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1506 (defcustom ebnf-user-arrow nil
31255
81113bfa57a5 Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30572
diff changeset
1507 "*Specify a sexp for user arrow shape (a PostScript code).
81113bfa57a5 Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30572
diff changeset
1508
81113bfa57a5 Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30572
diff changeset
1509 When evaluated, the sexp should return nil or a string containing PostScript
81113bfa57a5 Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30572
diff changeset
1510 code. PostScript code should draw a right arrow.
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1511
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1512 The anatomy of a right arrow is:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1513
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1514 ...... Initial position
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1515 :
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1516 : *.................
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1517 : | * } }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1518 : | * } hT4 }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1519 v | * } }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1520 ======+======*... } hT2
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1521 : | *: } }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1522 : | * : } hT4 }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1523 : | * : } }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1524 : *.................
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1525 : : :
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1526 : : :..........
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1527 : : } hT2 }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1528 : :.......... } hT
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1529 : } hT2 }
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1530 :.......................
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1531
30552
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
1532 Where `hT', `hT2' and `hT4' are predefined PostScript variable names that can
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
1533 be used to generate your own arrow. As these variables are used along
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
1534 PostScript execution, *DON'T* modify the values of them. Instead, copy the
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
1535 values, if you need to modify them.
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1536
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1537 The relation between these variables is: hT = 2 * hT2 = 4 * hT4.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1538
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1539 The variable `ebnf-user-arrow' is only used when `ebnf-arrow-shape' is set to
31255
81113bfa57a5 Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30572
diff changeset
1540 symbol `user'."
81113bfa57a5 Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30572
diff changeset
1541 :type '(sexp :tag "User Arrow Shape")
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1542 :group 'ebnf-shape)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1543
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1544
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1545 (defcustom ebnf-syntax 'ebnf
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1546 "*Specify syntax to be recognized.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1547
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1548 Valid values are:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1549
27495
507d8bb34bef (ebnf-syntax): Doc fix
Gerd Moellmann <gerd@gnu.org>
parents: 27451
diff changeset
1550 `ebnf' ebnf2ps recognizes the syntax described in ebnf2ps
507d8bb34bef (ebnf-syntax): Doc fix
Gerd Moellmann <gerd@gnu.org>
parents: 27451
diff changeset
1551 documentation.
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1552 The following variables *ONLY* have effect with this
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1553 setting:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1554 `ebnf-terminal-regexp', `ebnf-case-fold-search',
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1555 `ebnf-lex-comment-char' and `ebnf-lex-eop-char'.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1556
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1557 `iso-ebnf' ebnf2ps recognizes the syntax described in the URL:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1558 `http://www.cl.cam.ac.uk/~mgk25/iso-ebnf.html'
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1559 (\"International Standard of the ISO EBNF Notation\").
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1560 The following variables *ONLY* have effect with this
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1561 setting:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1562 `ebnf-iso-alternative-p' and `ebnf-iso-normalize-p'.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1563
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1564 `yacc' ebnf2ps recognizes the Yacc/Bison syntax.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1565 The following variable *ONLY* has effect with this
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1566 setting:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1567 `ebnf-yac-ignore-error-recovery'.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1568
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1569 Any other value is treated as `ebnf'."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1570 :type '(radio :tag "Syntax"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1571 (const ebnf) (const iso-ebnf) (const yacc))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1572 :group 'ebnf-syntatic)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1573
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1574
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1575 (defcustom ebnf-lex-comment-char ?\;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1576 "*Specify the line comment character.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1577
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1578 It's used only when `ebnf-syntax' is `ebnf'."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1579 :type 'character
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1580 :group 'ebnf-syntatic)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1581
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1582
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1583 (defcustom ebnf-lex-eop-char ?.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1584 "*Specify the end of production character.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1585
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1586 It's used only when `ebnf-syntax' is `ebnf'."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1587 :type 'character
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1588 :group 'ebnf-syntatic)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1589
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1590
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1591 (defcustom ebnf-terminal-regexp nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1592 "*Specify how it's a terminal name.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1593
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1594 If it's nil, the terminal name must be enclosed by `\"'.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1595 If it's a string, it should be a regexp that it'll be used to determine a
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1596 terminal name; terminal name may also be enclosed by `\"'.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1597
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1598 It's used only when `ebnf-syntax' is `ebnf'."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1599 :type '(radio :tag "Terminal Name"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1600 (const nil) regexp)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1601 :group 'ebnf-syntatic)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1602
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1603
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1604 (defcustom ebnf-case-fold-search nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1605 "*Non-nil means ignore case on matching.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1606
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1607 It's only used when `ebnf-terminal-regexp' is non-nil and when `ebnf-syntax' is
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1608 `ebnf'."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1609 :type 'boolean
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1610 :group 'ebnf-syntatic)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1611
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1612
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1613 (defcustom ebnf-iso-alternative-p nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1614 "*Non-nil means use alternative ISO EBNF.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1615
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1616 It's only used when `ebnf-syntax' is `iso-ebnf'.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1617
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1618 This variable affects the following symbol set:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1619
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1620 STANDARD ALTERNATIVE
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1621 | ==> / or !
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1622 [ ==> (/
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1623 ] ==> /)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1624 { ==> (:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1625 } ==> :)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1626 ; ==> ."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1627 :type 'boolean
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1628 :group 'ebnf-syntatic)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1629
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1630
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1631 (defcustom ebnf-iso-normalize-p nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1632 "*Non-nil means normalize ISO EBNF syntax names.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1633
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1634 Normalize a name means that several contiguous spaces inside name become a
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1635 single space, so \"A B C\" is normalized to \"A B C\".
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1636
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1637 It's only used when `ebnf-syntax' is `iso-ebnf'."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1638 :type 'boolean
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1639 :group 'ebnf-syntatic)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1640
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1641
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1642 (defcustom ebnf-eps-prefix "ebnf--"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1643 "*Specify EPS prefix file name.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1644
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1645 See `ebnf-eps-buffer' and `ebnf-eps-region' commands."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1646 :type 'string
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1647 :group 'ebnf2ps)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1648
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1649
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1650 (defcustom ebnf-entry-percentage 0.5 ; middle
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1651 "*Specify entry height on alternatives.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1652
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1653 It must be a float between 0.0 (top) and 1.0 (bottom)."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1654 :type 'number
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1655 :group 'ebnf2ps)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1656
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1657
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1658 (defcustom ebnf-default-width 0.6
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1659 "*Specify additional border width over default terminal, non-terminal or
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1660 special."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1661 :type 'number
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1662 :group 'ebnf2ps)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1663
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1664
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1665 ;; Printing color requires x-color-values.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1666 (defcustom ebnf-color-p (or (fboundp 'x-color-values) ; Emacs
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1667 (fboundp 'color-instance-rgb-components)) ; XEmacs
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1668 "*Non-nil means use color."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1669 :type 'boolean
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1670 :group 'ebnf2ps)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1671
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1672
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1673 (defcustom ebnf-line-width 1.0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1674 "*Specify flow line width."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1675 :type 'number
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1676 :group 'ebnf2ps)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1677
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1678
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1679 (defcustom ebnf-line-color "Black"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1680 "*Specify flow line color."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1681 :type 'string
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1682 :group 'ebnf2ps)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1683
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1684
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1685 (defcustom ebnf-debug-ps nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1686 "*Non-nil means to generate PostScript debug procedures.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1687
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1688 It is intended to help PostScript programmers in debugging."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1689 :type 'boolean
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1690 :group 'ebnf2ps)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1691
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1692
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1693 (defcustom ebnf-use-float-format t
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1694 "*Non-nil means use `%f' float format.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1695
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1696 The advantage of using float format is that ebnf2ps generates a little short
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1697 PostScript file.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1698
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1699 If it occurs the error message:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1700
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1701 Invalid format operation %f
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1702
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1703 when executing ebnf2ps, set `ebnf-use-float-format' to nil."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1704 :type 'boolean
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1705 :group 'ebnf2ps)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1706
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1707
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1708 (defcustom ebnf-yac-ignore-error-recovery nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1709 "*Non-nil means ignore error recovery.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1710
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1711 It's only used when `ebnf-syntax' is `yacc'."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1712 :type 'boolean
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1713 :group 'ebnf-syntatic)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1714
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1715
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1716 (defcustom ebnf-ignore-empty-rule nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1717 "*Non-nil means ignore empty rules.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1718
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1719 It's interesting to set this variable if your Yacc/Bison grammar has a lot of
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1720 middle action rule."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1721 :type 'boolean
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1722 :group 'ebnf-optimization)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1723
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1724
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1725 (defcustom ebnf-optimize nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1726 "*Non-nil means optimize syntatic chart of rules.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1727
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1728 The following optimizations are done:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1729
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1730 left recursion:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1731 1. A = B | A C. ==> A = B {C}*.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1732 2. A = B | A B. ==> A = {B}+.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1733 3. A = | A B. ==> A = {B}*.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1734 4. A = B | A C B. ==> A = {B || C}+.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1735 5. A = B | D | A C | A E. ==> A = ( B | D ) { C | E }*.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1736
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1737 optional:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1738 6. A = B | . ==> A = [B].
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1739 7. A = | B . ==> A = [B].
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1740
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1741 factoration:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1742 8. A = B C | B D. ==> A = B (C | D).
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1743 9. A = C B | D B. ==> A = (C | D) B.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1744 10. A = B C E | B D E. ==> A = B (C | D) E.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1745
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1746 The above optimizations are specially useful when `ebnf-syntax' is `yacc'."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1747 :type 'boolean
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1748 :group 'ebnf-optimization)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1749
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1750
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1751 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1752 ;; Customization
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1753
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1754
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1755 ;;;###autoload
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1756 (defun ebnf-customize ()
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1757 "Customization for ebnf group."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1758 (interactive)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1759 (customize-group 'ebnf2ps))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1760
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1761
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1762 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1763 ;; User commands
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1764
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1765
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1766 ;;;###autoload
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1767 (defun ebnf-print-buffer (&optional filename)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1768 "Generate and print a PostScript syntatic chart image of the buffer.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1769
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1770 When called with a numeric prefix argument (C-u), prompts the user for
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1771 the name of a file to save the PostScript image in, instead of sending
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1772 it to the printer.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1773
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1774 More specifically, the FILENAME argument is treated as follows: if it
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1775 is nil, send the image to the printer. If FILENAME is a string, save
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1776 the PostScript image in a file with that name. If FILENAME is a
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1777 number, prompt the user for the name of the file to save in."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1778 (interactive (list (ps-print-preprint current-prefix-arg)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1779 (ebnf-print-region (point-min) (point-max) filename))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1780
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1781
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1782 ;;;###autoload
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1783 (defun ebnf-print-region (from to &optional filename)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1784 "Generate and print a PostScript syntatic chart image of the region.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1785 Like `ebnf-print-buffer', but prints just the current region."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1786 (interactive (list (point) (mark) (ps-print-preprint current-prefix-arg)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1787 (run-hooks 'ebnf-hook)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1788 (or (ebnf-spool-region from to)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1789 (ps-do-despool filename)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1790
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1791
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1792 ;;;###autoload
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1793 (defun ebnf-spool-buffer ()
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1794 "Generate and spool a PostScript syntatic chart image of the buffer.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1795 Like `ebnf-print-buffer' except that the PostScript image is saved in a
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1796 local buffer to be sent to the printer later.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1797
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1798 Use the command `ebnf-despool' to send the spooled images to the printer."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1799 (interactive)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1800 (ebnf-spool-region (point-min) (point-max)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1801
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1802
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1803 ;;;###autoload
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1804 (defun ebnf-spool-region (from to)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1805 "Generate a PostScript syntatic chart image of the region and spool locally.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1806 Like `ebnf-spool-buffer', but spools just the current region.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1807
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1808 Use the command `ebnf-despool' to send the spooled images to the printer."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1809 (interactive "r")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1810 (ebnf-generate-region from to 'ebnf-generate))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1811
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1812
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1813 ;;;###autoload
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1814 (defun ebnf-eps-buffer ()
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1815 "Generate a PostScript syntatic chart image of the buffer in a EPS file.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1816
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1817 Indeed, for each production is generated a EPS file.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1818 The EPS file name has the following form:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1819
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1820 <PREFIX><PRODUCTION>.eps
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1821
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1822 <PREFIX> is given by variable `ebnf-eps-prefix'.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1823 The default value is \"ebnf--\".
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1824
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1825 <PRODUCTION> is the production name.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1826 The production name is mapped to form a valid file name.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1827 For example, the production name \"A/B + C\" is mapped to
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1828 \"A_B_+_C\" and the EPS file name used is \"ebnf--A_B_+_C.eps\".
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1829
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1830 WARNING: It's *NOT* asked any confirmation to override an existing file."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1831 (interactive)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1832 (ebnf-eps-region (point-min) (point-max)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1833
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1834
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1835 ;;;###autoload
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1836 (defun ebnf-eps-region (from to)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1837 "Generate a PostScript syntatic chart image of the region in a EPS file.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1838
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1839 Indeed, for each production is generated a EPS file.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1840 The EPS file name has the following form:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1841
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1842 <PREFIX><PRODUCTION>.eps
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1843
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1844 <PREFIX> is given by variable `ebnf-eps-prefix'.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1845 The default value is \"ebnf--\".
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1846
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1847 <PRODUCTION> is the production name.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1848 The production name is mapped to form a valid file name.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1849 For example, the production name \"A/B + C\" is mapped to
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1850 \"A_B_+_C\" and the EPS file name used is \"ebnf--A_B_+_C.eps\".
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1851
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1852 WARNING: It's *NOT* asked any confirmation to override an existing file."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1853 (interactive "r")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1854 (let ((ebnf-eps-executing t))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1855 (ebnf-generate-region from to 'ebnf-generate-eps)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1856
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1857
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1858 ;;;###autoload
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1859 (defalias 'ebnf-despool 'ps-despool)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1860
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1861
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1862 ;;;###autoload
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1863 (defun ebnf-syntax-buffer ()
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1864 "Does a syntatic analysis of the current buffer."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1865 (interactive)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1866 (ebnf-syntax-region (point-min) (point-max)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1867
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1868
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1869 ;;;###autoload
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1870 (defun ebnf-syntax-region (from to)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1871 "Does a syntatic analysis of a region."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1872 (interactive "r")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1873 (ebnf-generate-region from to nil))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1874
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1875
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1876 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1877 ;; Utilities
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1878
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1879
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1880 ;;;###autoload
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1881 (defun ebnf-setup ()
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1882 "Return the current ebnf2ps setup."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1883 (format
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1884 "
34803
de1f65fa5dcd Fix a problem with skip-chars-forward: it doesn't accept
Gerd Moellmann <gerd@gnu.org>
parents: 31255
diff changeset
1885 ;;; ebnf2ps.el version %s
de1f65fa5dcd Fix a problem with skip-chars-forward: it doesn't accept
Gerd Moellmann <gerd@gnu.org>
parents: 31255
diff changeset
1886
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1887 \(setq ebnf-special-font %s
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1888 ebnf-special-shape %s
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1889 ebnf-special-shadow %S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1890 ebnf-special-border-width %S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1891 ebnf-special-border-color %S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1892 ebnf-except-font %s
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1893 ebnf-except-shape %s
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1894 ebnf-except-shadow %S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1895 ebnf-except-border-width %S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1896 ebnf-except-border-color %S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1897 ebnf-repeat-font %s
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1898 ebnf-repeat-shape %s
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1899 ebnf-repeat-shadow %S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1900 ebnf-repeat-border-width %S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1901 ebnf-repeat-border-color %S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1902 ebnf-terminal-regexp %S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1903 ebnf-case-fold-search %S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1904 ebnf-terminal-font %s
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1905 ebnf-terminal-shape %s
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1906 ebnf-terminal-shadow %S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1907 ebnf-terminal-border-width %S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1908 ebnf-terminal-border-color %S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1909 ebnf-non-terminal-font %s
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1910 ebnf-non-terminal-shape %s
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1911 ebnf-non-terminal-shadow %S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1912 ebnf-non-terminal-border-width %S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1913 ebnf-non-terminal-border-color %S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1914 ebnf-sort-production %s
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1915 ebnf-production-font %s
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1916 ebnf-arrow-shape %s
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1917 ebnf-chart-shape %s
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1918 ebnf-user-arrow %s
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1919 ebnf-horizontal-orientation %S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1920 ebnf-horizontal-max-height %S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1921 ebnf-production-horizontal-space %S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1922 ebnf-production-vertical-space %S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1923 ebnf-justify-sequence %s
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1924 ebnf-lex-comment-char ?\\%03o
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1925 ebnf-lex-eop-char ?\\%03o
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1926 ebnf-syntax %s
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1927 ebnf-iso-alternative-p %S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1928 ebnf-iso-normalize-p %S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1929 ebnf-eps-prefix %S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1930 ebnf-entry-percentage %S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1931 ebnf-color-p %S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1932 ebnf-line-width %S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1933 ebnf-line-color %S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1934 ebnf-debug-ps %S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1935 ebnf-use-float-format %S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1936 ebnf-yac-ignore-error-recovery %S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1937 ebnf-ignore-empty-rule %S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1938 ebnf-optimize %S)
34803
de1f65fa5dcd Fix a problem with skip-chars-forward: it doesn't accept
Gerd Moellmann <gerd@gnu.org>
parents: 31255
diff changeset
1939
de1f65fa5dcd Fix a problem with skip-chars-forward: it doesn't accept
Gerd Moellmann <gerd@gnu.org>
parents: 31255
diff changeset
1940 ;;; ebnf2ps.el - end of settings
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1941 "
34803
de1f65fa5dcd Fix a problem with skip-chars-forward: it doesn't accept
Gerd Moellmann <gerd@gnu.org>
parents: 31255
diff changeset
1942 ebnf-version
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1943 (ps-print-quote ebnf-special-font)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1944 (ps-print-quote ebnf-special-shape)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1945 ebnf-special-shadow
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1946 ebnf-special-border-width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1947 ebnf-special-border-color
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1948 (ps-print-quote ebnf-except-font)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1949 (ps-print-quote ebnf-except-shape)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1950 ebnf-except-shadow
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1951 ebnf-except-border-width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1952 ebnf-except-border-color
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1953 (ps-print-quote ebnf-repeat-font)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1954 (ps-print-quote ebnf-repeat-shape)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1955 ebnf-repeat-shadow
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1956 ebnf-repeat-border-width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1957 ebnf-repeat-border-color
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1958 ebnf-terminal-regexp
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1959 ebnf-case-fold-search
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1960 (ps-print-quote ebnf-terminal-font)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1961 (ps-print-quote ebnf-terminal-shape)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1962 ebnf-terminal-shadow
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1963 ebnf-terminal-border-width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1964 ebnf-terminal-border-color
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1965 (ps-print-quote ebnf-non-terminal-font)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1966 (ps-print-quote ebnf-non-terminal-shape)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1967 ebnf-non-terminal-shadow
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1968 ebnf-non-terminal-border-width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1969 ebnf-non-terminal-border-color
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1970 (ps-print-quote ebnf-sort-production)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1971 (ps-print-quote ebnf-production-font)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1972 (ps-print-quote ebnf-arrow-shape)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1973 (ps-print-quote ebnf-chart-shape)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1974 (ps-print-quote ebnf-user-arrow)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1975 ebnf-horizontal-orientation
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1976 ebnf-horizontal-max-height
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1977 ebnf-production-horizontal-space
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1978 ebnf-production-vertical-space
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1979 (ps-print-quote ebnf-justify-sequence)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1980 ebnf-lex-comment-char
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1981 ebnf-lex-eop-char
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1982 (ps-print-quote ebnf-syntax)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1983 ebnf-iso-alternative-p
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1984 ebnf-iso-normalize-p
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1985 ebnf-eps-prefix
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1986 ebnf-entry-percentage
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1987 ebnf-color-p
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1988 ebnf-line-width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1989 ebnf-line-color
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1990 ebnf-debug-ps
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1991 ebnf-use-float-format
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1992 ebnf-yac-ignore-error-recovery
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1993 ebnf-ignore-empty-rule
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1994 ebnf-optimize))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1995
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1996
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1997 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1998 ;; Style variables
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1999
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2000
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2001 (defvar ebnf-stack-style nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2002 "Used in functions `ebnf-reset-style', `ebnf-push-style' and
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2003 `ebnf-pop-style'.")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2004
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2005
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2006 (defvar ebnf-current-style 'default
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2007 "Used in functions `ebnf-apply-style' and `ebnf-push-style'.")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2008
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2009
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2010 (defconst ebnf-style-custom-list
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2011 '(ebnf-special-font
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2012 ebnf-special-shape
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2013 ebnf-special-shadow
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2014 ebnf-special-border-width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2015 ebnf-special-border-color
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2016 ebnf-except-font
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2017 ebnf-except-shape
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2018 ebnf-except-shadow
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2019 ebnf-except-border-width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2020 ebnf-except-border-color
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2021 ebnf-repeat-font
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2022 ebnf-repeat-shape
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2023 ebnf-repeat-shadow
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2024 ebnf-repeat-border-width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2025 ebnf-repeat-border-color
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2026 ebnf-terminal-regexp
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2027 ebnf-case-fold-search
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2028 ebnf-terminal-font
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2029 ebnf-terminal-shape
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2030 ebnf-terminal-shadow
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2031 ebnf-terminal-border-width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2032 ebnf-terminal-border-color
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2033 ebnf-non-terminal-font
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2034 ebnf-non-terminal-shape
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2035 ebnf-non-terminal-shadow
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2036 ebnf-non-terminal-border-width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2037 ebnf-non-terminal-border-color
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2038 ebnf-sort-production
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2039 ebnf-production-font
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2040 ebnf-arrow-shape
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2041 ebnf-chart-shape
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2042 ebnf-user-arrow
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2043 ebnf-horizontal-orientation
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2044 ebnf-horizontal-max-height
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2045 ebnf-production-horizontal-space
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2046 ebnf-production-vertical-space
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2047 ebnf-justify-sequence
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2048 ebnf-lex-comment-char
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2049 ebnf-lex-eop-char
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2050 ebnf-syntax
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2051 ebnf-iso-alternative-p
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2052 ebnf-iso-normalize-p
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2053 ebnf-eps-prefix
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2054 ebnf-entry-percentage
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2055 ebnf-color-p
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2056 ebnf-line-width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2057 ebnf-line-color
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2058 ebnf-debug-ps
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2059 ebnf-use-float-format
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2060 ebnf-yac-ignore-error-recovery
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2061 ebnf-ignore-empty-rule
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2062 ebnf-optimize)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2063 "List of valid symbol custom variable.")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2064
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2065
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2066 (defvar ebnf-style-database
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2067 '(;; EBNF default
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2068 (default
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2069 nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2070 (ebnf-special-font . '(7 Courier "Black" "Gray95" bold italic))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2071 (ebnf-special-shape . 'bevel)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2072 (ebnf-special-shadow . nil)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2073 (ebnf-special-border-width . 0.5)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2074 (ebnf-special-border-color . "Black")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2075 (ebnf-except-font . '(7 Courier "Black" "Gray90" bold italic))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2076 (ebnf-except-shape . 'bevel)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2077 (ebnf-except-shadow . nil)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2078 (ebnf-except-border-width . 0.25)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2079 (ebnf-except-border-color . "Black")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2080 (ebnf-repeat-font . '(7 Courier "Black" "Gray85" bold italic))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2081 (ebnf-repeat-shape . 'bevel)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2082 (ebnf-repeat-shadow . nil)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2083 (ebnf-repeat-border-width . 0.0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2084 (ebnf-repeat-border-color . "Black")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2085 (ebnf-terminal-regexp . nil)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2086 (ebnf-case-fold-search . nil)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2087 (ebnf-terminal-font . '(7 Courier "Black" "White"))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2088 (ebnf-terminal-shape . 'miter)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2089 (ebnf-terminal-shadow . nil)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2090 (ebnf-terminal-border-width . 1.0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2091 (ebnf-terminal-border-color . "Black")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2092 (ebnf-non-terminal-font . '(7 Helvetica "Black" "White"))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2093 (ebnf-non-terminal-shape . 'round)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2094 (ebnf-non-terminal-shadow . nil)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2095 (ebnf-non-terminal-border-width . 1.0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2096 (ebnf-non-terminal-border-color . "Black")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2097 (ebnf-sort-production . nil)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2098 (ebnf-production-font . '(10 Helvetica "Black" "White" bold))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2099 (ebnf-arrow-shape . 'hollow)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2100 (ebnf-chart-shape . 'round)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2101 (ebnf-user-arrow . nil)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2102 (ebnf-horizontal-orientation . nil)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2103 (ebnf-horizontal-max-height . nil)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2104 (ebnf-production-horizontal-space . 0.0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2105 (ebnf-production-vertical-space . 0.0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2106 (ebnf-justify-sequence . 'center)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2107 (ebnf-lex-comment-char . ?\;)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2108 (ebnf-lex-eop-char . ?.)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2109 (ebnf-syntax . 'ebnf)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2110 (ebnf-iso-alternative-p . nil)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2111 (ebnf-iso-normalize-p . nil)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2112 (ebnf-eps-prefix . "ebnf--")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2113 (ebnf-entry-percentage . 0.5)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2114 (ebnf-color-p . (or (fboundp 'x-color-values) ; Emacs
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2115 (fboundp 'color-instance-rgb-components))) ; XEmacs
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2116 (ebnf-line-width . 1.0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2117 (ebnf-line-color . "Black")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2118 (ebnf-debug-ps . nil)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2119 (ebnf-use-float-format . t)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2120 (ebnf-yac-ignore-error-recovery . nil)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2121 (ebnf-ignore-empty-rule . nil)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2122 (ebnf-optimize . nil))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2123 ;; Happy EBNF default
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2124 (happy
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2125 default
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2126 (ebnf-justify-sequence . 'left)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2127 (ebnf-lex-comment-char . ?\#)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2128 (ebnf-lex-eop-char . ?\;))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2129 ;; ISO EBNF default
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2130 (iso-ebnf
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2131 default
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2132 (ebnf-syntax . 'iso-ebnf))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2133 ;; Yacc/Bison default
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2134 (yacc
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2135 default
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2136 (ebnf-syntax . 'yacc))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2137 )
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2138 "Style database.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2139
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2140 Each element has the following form:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2141
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2142 (CUSTOM INHERITS (VAR . VALUE)...)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2143
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2144 CUSTOM is a symbol name style.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2145 INHERITS is a symbol name style from which the current style inherits the
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2146 context. If INHERITS is nil, means that there is no inheritance.
30552
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
2147 VAR is a valid ebnf2ps symbol custom variable. See `ebnf-style-custom-list'
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
2148 for valid symbol variable.
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2149 VALUE is a sexp which it'll be evaluated to set the value to VAR. So, don't
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2150 forget to quote symbols and constant lists. See `default' style for an
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2151 example.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2152
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2153 Don't handle this variable directly. Use functions `ebnf-insert-style' and
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2154 `ebnf-merge-style'.")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2155
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2156
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2157 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2158 ;; Style commands
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2159
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2160
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2161 ;;;###autoload
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2162 (defun ebnf-insert-style (name inherits &rest values)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2163 "Insert a new style NAME with inheritance INHERITS and values VALUES."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2164 (interactive)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2165 (and (assoc name ebnf-style-database)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2166 (error "Style name already exists: %s" name))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2167 (or (assoc inherits ebnf-style-database)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2168 (error "Style inheritance name does'nt exist: %s" inherits))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2169 (setq ebnf-style-database
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2170 (cons (cons name (cons inherits (ebnf-check-style-values values)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2171 ebnf-style-database)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2172
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2173
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2174 ;;;###autoload
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2175 (defun ebnf-merge-style (name &rest values)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2176 "Merge values of style NAME with style VALUES."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2177 (interactive)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2178 (let ((style (or (assoc name ebnf-style-database)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2179 (error "Style name does'nt exist: %s" name)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2180 (merge (ebnf-check-style-values values))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2181 val elt new check)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2182 ;; modify value of existing variables
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2183 (setq val (nthcdr 2 style))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2184 (while merge
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2185 (setq check (car merge)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2186 merge (cdr merge)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2187 elt (assoc (car check) val))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2188 (if elt
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2189 (setcdr elt (cdr check))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2190 (setq new (cons check new))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2191 ;; insert new variables
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2192 (nconc style (nreverse new))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2193
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2194
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2195 ;;;###autoload
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2196 (defun ebnf-apply-style (style)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2197 "Set STYLE to current style.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2198
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2199 It returns the old style symbol."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2200 (interactive)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2201 (prog1
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2202 ebnf-current-style
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2203 (and (ebnf-apply-style1 style)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2204 (setq ebnf-current-style style))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2205
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2206
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2207 ;;;###autoload
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2208 (defun ebnf-reset-style (&optional style)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2209 "Reset current style.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2210
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2211 It returns the old style symbol."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2212 (interactive)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2213 (setq ebnf-stack-style nil)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2214 (ebnf-apply-style (or style 'default)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2215
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2216
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2217 ;;;###autoload
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2218 (defun ebnf-push-style (&optional style)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2219 "Push the current style and set STYLE to current style.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2220
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2221 It returns the old style symbol."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2222 (interactive)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2223 (prog1
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2224 ebnf-current-style
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2225 (setq ebnf-stack-style (cons ebnf-current-style ebnf-stack-style))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2226 (and style
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2227 (ebnf-apply-style style))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2228
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2229
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2230 ;;;###autoload
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2231 (defun ebnf-pop-style ()
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2232 "Pop a style and set it to current style.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2233
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2234 It returns the old style symbol."
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2235 (interactive)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2236 (prog1
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2237 (ebnf-apply-style (car ebnf-stack-style))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2238 (setq ebnf-stack-style (cdr ebnf-stack-style))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2239
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2240
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2241 (defun ebnf-apply-style1 (style)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2242 (let ((value (cdr (assoc style ebnf-style-database))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2243 (prog1
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2244 value
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2245 (and (car value) (ebnf-apply-style1 (car value)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2246 (while (setq value (cdr value))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2247 (set (caar value) (eval (cdar value)))))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2248
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2249
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2250 (defun ebnf-check-style-values (values)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2251 (let (style)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2252 (while values
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2253 (and (memq (car values) ebnf-style-custom-list)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2254 (setq style (cons (car values) style)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2255 (setq values (cdr values)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2256 (nreverse style)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2257
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2258
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2259 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2260 ;; Internal variables
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2261
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2262
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2263 (make-local-hook 'ebnf-hook)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2264 (make-local-hook 'ebnf-production-hook)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2265 (make-local-hook 'ebnf-page-hook)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2266
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2267
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2268 (defvar ebnf-eps-buffer-name " *EPS*")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2269 (defvar ebnf-parser-func nil)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2270 (defvar ebnf-eps-executing nil)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2271 (defvar ebnf-eps-upper-x 0.0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2272 (make-variable-buffer-local 'ebnf-eps-upper-x)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2273 (defvar ebnf-eps-upper-y 0.0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2274 (make-variable-buffer-local 'ebnf-eps-upper-y)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2275 (defvar ebnf-eps-prod-width 0.0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2276 (make-variable-buffer-local 'ebnf-eps-prod-width)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2277 (defvar ebnf-eps-max-height 0.0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2278 (make-variable-buffer-local 'ebnf-eps-max-height)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2279 (defvar ebnf-eps-max-width 0.0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2280 (make-variable-buffer-local 'ebnf-eps-max-width)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2281
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2282
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2283 (defvar ebnf-eps-context nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2284 "List of EPS file name during parsing.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2285
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2286 See section \"Actions in Comments\" in ebnf2ps documentation.")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2287
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2288
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2289 (defvar ebnf-eps-production-list nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2290 "Alist associating production name with EPS file name list.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2291
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2292 Each element has the following form:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2293
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2294 (PRODUCTION EPS-FILENAME...)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2295
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2296 PRODUCTION is the production name.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2297 EPS-FILENAME is the EPS file name.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2298
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2299 It's generated during parsing and used during EPS generation.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2300
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2301 See `ebnf-eps-context' and section \"Actions in Comments\" in ebnf2ps
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2302 documentation.")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2303
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2304
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2305 (defconst ebnf-arrow-shape-alist
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2306 '((none . 0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2307 (semi-up . 1)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2308 (semi-down . 2)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2309 (simple . 3)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2310 (transparent . 4)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2311 (hollow . 5)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2312 (full . 6)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2313 (user . 7))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2314 "Alist associating values for `ebnf-arrow-shape'.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2315
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2316 See documentation for `ebnf-arrow-shape'.")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2317
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2318
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2319 (defconst ebnf-terminal-shape-alist
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2320 '((miter . 0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2321 (round . 1)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2322 (bevel . 2))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2323 "Alist associating values from `ebnf-terminal-shape' to a bit vector.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2324
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2325 See documentation for `ebnf-terminal-shape', `ebnf-non-terminal-shape' and
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2326 `ebnf-chart-shape'.")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2327
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2328
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2329 (defvar ebnf-limit nil)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2330 (defvar ebnf-action nil)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2331 (defvar ebnf-action-list nil)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2332
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2333
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2334 (defvar ebnf-default-p nil)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2335
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2336
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2337 (defvar ebnf-font-height-P 0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2338 (defvar ebnf-font-height-T 0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2339 (defvar ebnf-font-height-NT 0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2340 (defvar ebnf-font-height-S 0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2341 (defvar ebnf-font-height-E 0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2342 (defvar ebnf-font-height-R 0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2343 (defvar ebnf-font-width-P 0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2344 (defvar ebnf-font-width-T 0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2345 (defvar ebnf-font-width-NT 0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2346 (defvar ebnf-font-width-S 0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2347 (defvar ebnf-font-width-E 0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2348 (defvar ebnf-font-width-R 0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2349 (defvar ebnf-space-T 0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2350 (defvar ebnf-space-NT 0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2351 (defvar ebnf-space-S 0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2352 (defvar ebnf-space-E 0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2353 (defvar ebnf-space-R 0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2354
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2355
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2356 (defvar ebnf-basic-width 0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2357 (defvar ebnf-basic-height 0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2358 (defvar ebnf-vertical-space 0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2359 (defvar ebnf-horizontal-space 0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2360
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2361
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2362 (defvar ebnf-settings nil)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2363 (defvar ebnf-fonts-required nil)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2364
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2365
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2366 (defconst ebnf-debug
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2367 "
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2368 % === begin EBNF procedures to help debugging
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2369
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2370 % Mark visually current point: string debug
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2371 /debug
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2372 {/-s- exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2373 currentpoint
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2374 gsave -s- show grestore
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2375 gsave
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2376 20 20 rlineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2377 0 -40 rlineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2378 -40 40 rlineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2379 0 -40 rlineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2380 20 20 rlineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2381 stroke
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2382 grestore
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2383 moveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2384 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2385
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2386 % Show number value: number string debug-number
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2387 /debug-number
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2388 {gsave
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2389 20 0 rmoveto show ([) show 60 string cvs show (]) show
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2390 grestore
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2391 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2392
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2393 % === end EBNF procedures to help debugging
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2394
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2395 "
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2396 "This is intended to help debugging PostScript programming.")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2397
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2398
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2399 (defconst ebnf-prologue
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2400 "
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2401 % === begin EBNF engine
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2402
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2403 % --- Basic Definitions
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2404
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2405 /fS F
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2406 /SpaceS FontHeight 0.5 mul def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2407 /HeightS FontHeight FontHeight add def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2408
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2409 /fE F
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2410 /SpaceE FontHeight 0.5 mul def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2411 /HeightE FontHeight FontHeight add def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2412
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2413 /fR F
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2414 /SpaceR FontHeight 0.5 mul def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2415 /HeightR FontHeight FontHeight add def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2416
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2417 /fT F
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2418 /SpaceT FontHeight 0.5 mul def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2419 /HeightT FontHeight FontHeight add def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2420
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2421 /fNT F
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2422 /SpaceNT FontHeight 0.5 mul def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2423 /HeightNT FontHeight FontHeight add def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2424
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2425 /T HeightT HeightNT add 0.5 mul def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2426 /hT T 0.5 mul def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2427 /hT2 hT 0.5 mul def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2428 /hT4 hT 0.25 mul def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2429
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2430 /Er 0.1 def % Error factor
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2431
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2432
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2433 /c{currentpoint}bind def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2434 /xyi{/xi c /yi exch def def}bind def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2435 /xyo{/xo c /yo exch def def}bind def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2436 /xyp{/xp c /yp exch def def}bind def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2437 /xyt{/xt c /yt exch def def}bind def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2438
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2439 % vertical movement: x y height vm
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2440 /vm{add moveto}bind def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2441
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2442 % horizontal movement: x y width hm
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2443 /hm{3 -1 roll exch add exch moveto}bind def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2444
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2445 % set color: [R G B] SetRGB
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2446 /SetRGB{aload pop setrgbcolor}bind def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2447
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2448 % filling gray area: gray-scale FillGray
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2449 /FillGray{gsave setgray fill grestore}bind def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2450
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2451 % filling color area: [R G B] FillRGB
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2452 /FillRGB{gsave SetRGB fill grestore}bind def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2453
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2454 /Stroke{LineWidth setlinewidth LineColor SetRGB stroke}bind def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2455 /StrokeShape{borderwidth setlinewidth bordercolor SetRGB stroke}bind def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2456 /Gstroke{gsave Stroke grestore}bind def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2457
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2458 % Empty Line: width EL
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2459 /EL{0 rlineto Gstroke}bind def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2460
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2461 % --- Arrows
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2462
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2463 /Down{hT2 neg hT4 neg rlineto}bind def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2464
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2465 /Arrow
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2466 {hT2 neg hT4 rmoveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2467 hT2 hT4 neg rlineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2468 Down
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2469 }bind def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2470
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2471 /ArrowPath{c newpath moveto Arrow closepath}bind def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2472
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2473 %>Right Arrow: RA
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2474 % \\
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2475 % *---+
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2476 % /
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2477 /RA-vector
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2478 [{} % 0 - none
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2479 {hT2 neg hT4 rlineto} % 1 - semi-up
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2480 {Down} % 2 - semi-down
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2481 {Arrow} % 3 - simple
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2482 {Gstroke ArrowPath} % 4 - transparent
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2483 {Gstroke ArrowPath 1 FillGray} % 5 - hollow
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2484 {Gstroke ArrowPath LineColor FillRGB} % 6 - full
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2485 {Gstroke gsave UserArrow grestore} % 7 - user
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2486 ]def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2487
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2488 /RA
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2489 {hT 0 rlineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2490 c
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2491 RA-vector ArrowShape get exec
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2492 Gstroke
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2493 moveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2494 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2495
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2496 % rotation DrawArrow
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2497 /DrawArrow
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2498 {gsave
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2499 0 0 translate
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2500 rotate
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2501 RA
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2502 c
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2503 grestore
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2504 rmoveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2505 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2506
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2507 %>Left Arrow: LA
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2508 % /
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2509 % +---*
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2510 % \\
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2511 /LA{180 DrawArrow}def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2512
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2513 %>Up Arrow: UA
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2514 % +
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2515 % /|\\
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2516 % |
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2517 % *
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2518 /UA{90 DrawArrow}def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2519
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2520 %>Down Arrow: DA
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2521 % *
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2522 % |
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2523 % \\|/
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2524 % +
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2525 /DA{270 DrawArrow}def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2526
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2527 % --- Corners
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2528
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2529 %>corner Right Descendent: height arrow corner_RD
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2530 % _ | arrow
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2531 % / height > 0 | 0 - none
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2532 % | | 1 - right
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2533 % * ---------- | 2 - left
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2534 % | | 3 - vertical
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2535 % \\ height < 0 |
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2536 % - |
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2537 /cRD0-vector
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2538 [% 0 - none
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2539 {0 h rlineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2540 hT 0 rlineto}
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2541 % 1 - right
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2542 {0 h rlineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2543 RA}
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2544 % 2 - left
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2545 {hT 0 rmoveto xyi
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2546 LA
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2547 0 h neg rlineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2548 xi yi moveto}
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2549 % 3 - vertical
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2550 {hT h rmoveto xyi
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2551 hT neg 0 rlineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2552 h 0 gt{DA}{UA}ifelse
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2553 xi yi moveto}
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2554 ]def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2555
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2556 /cRD-vector
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2557 [{cRD0-vector arrow get exec} % 0 - miter
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2558 {0 0 0 h hT h rcurveto} % 1 - rounded
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2559 {hT h rlineto} % 2 - bevel
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2560 ]def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2561
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2562 /corner_RD
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2563 {/arrow exch def /h exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2564 cRD-vector ChartShape get exec
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2565 Gstroke
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2566 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2567
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2568 %>corner Right Ascendent: height arrow corner_RA
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2569 % | arrow
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2570 % | height > 0 | 0 - none
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2571 % / | 1 - right
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2572 % *- ---------- | 2 - left
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2573 % \\ | 3 - vertical
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2574 % | height < 0 |
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2575 % |
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2576 /cRA0-vector
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2577 [% 0 - none
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2578 {hT 0 rlineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2579 0 h rlineto}
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2580 % 1 - right
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2581 {RA
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2582 0 h rlineto}
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2583 % 2 - left
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2584 {hT h rmoveto xyi
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2585 0 h neg rlineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2586 LA
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2587 xi yi moveto}
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2588 % 3 - vertical
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2589 {hT h rmoveto xyi
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2590 h 0 gt{DA}{UA}ifelse
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2591 hT neg 0 rlineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2592 xi yi moveto}
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2593 ]def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2594
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2595 /cRA-vector
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2596 [{cRA0-vector arrow get exec} % 0 - miter
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2597 {0 0 hT 0 hT h rcurveto} % 1 - rounded
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2598 {hT h rlineto} % 2 - bevel
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2599 ]def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2600
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2601 /corner_RA
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2602 {/arrow exch def /h exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2603 cRA-vector ChartShape get exec
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2604 Gstroke
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2605 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2606
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2607 %>corner Left Descendent: height arrow corner_LD
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2608 % _ | arrow
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2609 % \\ height > 0 | 0 - none
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2610 % | | 1 - right
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2611 % * ---------- | 2 - left
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2612 % | | 3 - vertical
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2613 % / height < 0 |
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2614 % - |
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2615 /cLD0-vector
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2616 [% 0 - none
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2617 {0 h rlineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2618 hT neg 0 rlineto}
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2619 % 1 - right
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2620 {hT neg h rmoveto xyi
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2621 RA
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2622 0 h neg rlineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2623 xi yi moveto}
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2624 % 2 - left
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2625 {0 h rlineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2626 LA}
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2627 % 3 - vertical
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2628 {hT neg h rmoveto xyi
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2629 hT 0 rlineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2630 h 0 gt{DA}{UA}ifelse
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2631 xi yi moveto}
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2632 ]def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2633
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2634 /cLD-vector
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2635 [{cLD0-vector arrow get exec} % 0 - miter
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2636 {0 0 0 h hT neg h rcurveto} % 1 - rounded
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2637 {hT neg h rlineto} % 2 - bevel
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2638 ]def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2639
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2640 /corner_LD
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2641 {/arrow exch def /h exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2642 cLD-vector ChartShape get exec
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2643 Gstroke
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2644 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2645
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2646 %>corner Left Ascendent: height arrow corner_LA
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2647 % | arrow
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2648 % | height > 0 | 0 - none
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2649 % \\ | 1 - right
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2650 % -* ---------- | 2 - left
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2651 % / | 3 - vertical
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2652 % | height < 0 |
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2653 % |
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2654 /cLA0-vector
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2655 [% 0 - none
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2656 {hT neg 0 rlineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2657 0 h rlineto}
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2658 % 1 - right
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2659 {hT neg h rmoveto xyi
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2660 0 h neg rlineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2661 RA
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2662 xi yi moveto}
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2663 % 2 - left
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2664 {LA
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2665 0 h rlineto}
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2666 % 3 - vertical
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2667 {hT neg h rmoveto xyi
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2668 h 0 gt{DA}{UA}ifelse
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2669 hT 0 rlineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2670 xi yi moveto}
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2671 ]def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2672
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2673 /cLA-vector
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2674 [{cLA0-vector arrow get exec} % 0 - miter
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2675 {0 0 hT neg 0 hT neg h rcurveto} % 1 - rounded
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2676 {hT neg h rlineto} % 2 - bevel
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2677 ]def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2678
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2679 /corner_LA
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2680 {/arrow exch def /h exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2681 cLA-vector ChartShape get exec
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2682 Gstroke
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2683 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2684
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2685 % --- Flow Stuff
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2686
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2687 % height prepare_height |- line_height corner_height corner_height
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2688 /prepare_height
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2689 {dup 0 gt
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2690 {T sub hT}
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2691 {T add hT neg}ifelse
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2692 dup
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2693 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2694
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2695 %>Left Alternative: height LAlt
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2696 % _
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2697 % /
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2698 % | height > 0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2699 % |
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2700 % /
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2701 % *- ----------
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2702 % \\
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2703 % |
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2704 % | height < 0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2705 % \\
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2706 % -
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2707 /LAlt
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2708 {dup 0 eq
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2709 {T exch rlineto}
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2710 {dup abs T lt
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2711 {0.5 mul dup
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2712 1 corner_RA
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2713 0 corner_RD}
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2714 {prepare_height
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2715 1 corner_RA
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2716 exch 0 exch rlineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2717 0 corner_RD
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2718 }ifelse
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2719 }ifelse
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2720 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2721
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2722 %>Left Loop: height LLoop
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2723 % _
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2724 % /
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2725 % | height > 0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2726 % |
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2727 % \\
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2728 % -* ----------
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2729 % /
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2730 % |
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2731 % | height < 0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2732 % \\
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2733 % -
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2734 /LLoop
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2735 {prepare_height
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2736 3 corner_LA
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2737 exch 0 exch rlineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2738 0 corner_RD
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2739 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2740
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2741 %>Right Alternative: height RAlt
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2742 % _
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2743 % \\
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2744 % | height > 0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2745 % |
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2746 % \\
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2747 % -* ----------
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2748 % /
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2749 % |
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2750 % | height < 0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2751 % /
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2752 % -
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2753 /RAlt
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2754 {dup 0 eq
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2755 {T neg exch rlineto}
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2756 {dup abs T lt
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2757 {0.5 mul dup
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2758 1 corner_LA
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2759 0 corner_LD}
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2760 {prepare_height
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2761 1 corner_LA
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2762 exch 0 exch rlineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2763 0 corner_LD
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2764 }ifelse
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2765 }ifelse
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2766 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2767
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2768 %>Right Loop: height RLoop
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2769 % _
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2770 % \\
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2771 % | height > 0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2772 % |
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2773 % /
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2774 % *- ----------
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2775 % \\
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2776 % |
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2777 % | height < 0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2778 % /
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2779 % -
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2780 /RLoop
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2781 {prepare_height
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2782 1 corner_RA
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2783 exch 0 exch rlineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2784 0 corner_LD
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2785 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2786
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2787 % --- Terminal, Non-terminal and Special Basics
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2788
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2789 % string width prepare-width |- string
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2790 /prepare-width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2791 {/width exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2792 dup stringwidth pop space add space add width exch sub 0.5 mul
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2793 /w exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2794 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2795
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2796 % string width begin-right
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2797 /begin-right
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2798 {xyo
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2799 prepare-width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2800 w hT sub EL
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2801 RA
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2802 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2803
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2804 % end-right
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2805 /end-right
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2806 {xo width add Er add yo moveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2807 w Er add neg EL
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2808 xo yo moveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2809 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2810
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2811 % string width begin-left
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2812 /begin-left
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2813 {xyo
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2814 prepare-width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2815 w EL
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2816 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2817
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2818 % end-left
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2819 /end-left
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2820 {xo width add Er add yo moveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2821 hT w sub Er add EL
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2822 LA
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2823 xo yo moveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2824 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2825
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2826 /ShapePath-vector
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2827 [% 0 - miter
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2828 {xx yy moveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2829 xx YY lineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2830 XX YY lineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2831 XX yy lineto}
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2832 % 1 - rounded
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2833 {/half YY yy sub 0.5 mul abs def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2834 xx half add YY moveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2835 0 0 half neg 0 half neg half neg rcurveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2836 0 0 0 half neg half half neg rcurveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2837 XX xx sub abs half sub half sub 0 rlineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2838 0 0 half 0 half half rcurveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2839 0 0 0 half half neg half rcurveto}
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2840 % 2 - bevel
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2841 {/quarter YY yy sub 0.25 mul abs def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2842 xx quarter add YY moveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2843 quarter neg quarter neg rlineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2844 0 quarter quarter add neg rlineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2845 quarter quarter neg rlineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2846 XX xx sub abs quarter sub quarter sub 0 rlineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2847 quarter quarter rlineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2848 0 quarter quarter add rlineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2849 quarter neg quarter rlineto}
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2850 ]def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2851
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2852 /doShapePath
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2853 {newpath
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2854 ShapePath-vector shape get exec
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2855 closepath
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2856 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2857
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2858 /doShapeShadow
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2859 {gsave
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2860 Xshadow Xshadow add Xshadow add
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2861 Yshadow Yshadow add Yshadow add translate
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2862 doShapePath
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2863 0.9 FillGray
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2864 grestore
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2865 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2866
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2867 /doShape
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2868 {gsave
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2869 doShapePath
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2870 shapecolor FillRGB
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2871 StrokeShape
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2872 grestore
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2873 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2874
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2875 % string SBound |- string
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2876 /SBound
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2877 {/xx c dup /yy exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2878 FontHeight add /YY exch def def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2879 dup stringwidth pop xx add /XX exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2880 Effect 8 and 0 ne
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2881 {/yy yy YShadow add def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2882 /XX XX XShadow add def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2883 }if
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2884 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2885
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2886 % string SBox
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2887 /SBox
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2888 {gsave
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2889 c space sub moveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2890 SBound
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2891 /XX XX space add space add def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2892 /YY YY space add def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2893 /yy yy space sub def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2894 shadow{doShapeShadow}if
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2895 doShape
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2896 space Descent abs rmoveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2897 foreground SetRGB S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2898 grestore
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2899 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2900
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2901 % --- Terminal
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2902
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2903 % TeRminal: string TR
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2904 /TR
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2905 {/Effect EffectT def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2906 /shape ShapeT def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2907 /shapecolor BackgroundT def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2908 /borderwidth BorderWidthT def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2909 /bordercolor BorderColorT def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2910 /foreground ForegroundT def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2911 /shadow ShadowT def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2912 SBox
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2913 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2914
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2915 %>Right Terminal: string width RT |- x y
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2916 /RT
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2917 {xyt
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2918 /fT F
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2919 /space SpaceT def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2920 begin-right
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2921 TR
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2922 end-right
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2923 xt yt
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2924 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2925
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2926 %>Left Terminal: string width LT |- x y
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2927 /LT
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2928 {xyt
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2929 /fT F
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2930 /space SpaceT def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2931 begin-left
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2932 TR
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2933 end-left
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2934 xt yt
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2935 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2936
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2937 %>Right Terminal Default: string width RTD |- x y
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2938 /RTD
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2939 {/-save- BorderWidthT def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2940 /BorderWidthT BorderWidthT DefaultWidth add def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2941 RT
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2942 /BorderWidthT -save- def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2943 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2944
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2945 %>Left Terminal Default: string width LTD |- x y
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2946 /LTD
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2947 {/-save- BorderWidthT def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2948 /BorderWidthT BorderWidthT DefaultWidth add def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2949 LT
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2950 /BorderWidthT -save- def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2951 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2952
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2953 % --- Non-Terminal
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2954
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2955 % Non-Terminal: string NT
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2956 /NT
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2957 {/Effect EffectNT def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2958 /shape ShapeNT def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2959 /shapecolor BackgroundNT def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2960 /borderwidth BorderWidthNT def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2961 /bordercolor BorderColorNT def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2962 /foreground ForegroundNT def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2963 /shadow ShadowNT def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2964 SBox
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2965 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2966
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2967 %>Right Non-Terminal: string width RNT |- x y
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2968 /RNT
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2969 {xyt
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2970 /fNT F
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2971 /space SpaceNT def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2972 begin-right
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2973 NT
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2974 end-right
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2975 xt yt
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2976 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2977
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2978 %>Left Non-Terminal: string width LNT |- x y
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2979 /LNT
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2980 {xyt
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2981 /fNT F
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2982 /space SpaceNT def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2983 begin-left
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2984 NT
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2985 end-left
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2986 xt yt
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2987 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2988
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2989 %>Right Non-Terminal Default: string width RNTD |- x y
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2990 /RNTD
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2991 {/-save- BorderWidthNT def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2992 /BorderWidthNT BorderWidthNT DefaultWidth add def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2993 RNT
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2994 /BorderWidthNT -save- def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2995 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2996
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2997 %>Left Non-Terminal Default: string width LNTD |- x y
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2998 /LNTD
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2999 {/-save- BorderWidthNT def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3000 /BorderWidthNT BorderWidthNT DefaultWidth add def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3001 LNT
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3002 /BorderWidthNT -save- def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3003 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3004
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3005 % --- Special
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3006
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3007 % SPecial: string SP
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3008 /SP
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3009 {/Effect EffectS def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3010 /shape ShapeS def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3011 /shapecolor BackgroundS def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3012 /borderwidth BorderWidthS def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3013 /bordercolor BorderColorS def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3014 /foreground ForegroundS def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3015 /shadow ShadowS def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3016 SBox
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3017 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3018
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3019 %>Right SPecial: string width RSP |- x y
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3020 /RSP
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3021 {xyt
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3022 /fS F
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3023 /space SpaceS def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3024 begin-right
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3025 SP
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3026 end-right
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3027 xt yt
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3028 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3029
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3030 %>Left SPecial: string width LSP |- x y
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3031 /LSP
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3032 {xyt
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3033 /fS F
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3034 /space SpaceS def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3035 begin-left
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3036 SP
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3037 end-left
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3038 xt yt
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3039 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3040
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3041 %>Right SPecial Default: string width RSPD |- x y
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3042 /RSPD
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3043 {/-save- BorderWidthS def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3044 /BorderWidthS BorderWidthS DefaultWidth add def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3045 RSP
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3046 /BorderWidthS -save- def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3047 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3048
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3049 %>Left SPecial Default: string width LSPD |- x y
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3050 /LSPD
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3051 {/-save- BorderWidthS def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3052 /BorderWidthS BorderWidthS DefaultWidth add def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3053 LSP
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3054 /BorderWidthS -save- def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3055 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3056
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3057 % --- Repeat and Except basics
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3058
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3059 /begin-direction
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3060 {/w width rwidth sub 0.5 mul def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3061 width 0 rmoveto}def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3062
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3063 /end-direction
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3064 {gsave
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3065 /xx c entry add /YY exch def def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3066 /yy YY height sub def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3067 /XX xx rwidth add def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3068 shadow{doShapeShadow}if
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3069 doShape
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3070 grestore
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3071 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3072
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3073 /right-direction
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3074 {begin-direction
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3075 w neg EL
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3076 xt yt moveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3077 w hT sub EL RA
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3078 end-direction
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3079 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3080
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3081 /left-direction
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3082 {begin-direction
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3083 hT w sub EL LA
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3084 xt yt moveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3085 w EL
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3086 end-direction
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3087 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3088
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3089 % --- Repeat
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3090
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3091 % entry height width rwidth begin-repeat
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3092 /begin-repeat
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3093 {/rwidth exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3094 /width exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3095 /height exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3096 /entry exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3097 /fR F
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3098 /space SpaceR def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3099 /Effect EffectR def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3100 /shape ShapeR def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3101 /shapecolor BackgroundR def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3102 /borderwidth BorderWidthR def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3103 /bordercolor BorderColorR def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3104 /foreground ForegroundR def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3105 /shadow ShadowR def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3106 xyt
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3107 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3108
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3109 % string end-repeat |- x y
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3110 /end-repeat
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3111 {gsave
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3112 space Descent rmoveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3113 foreground SetRGB S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3114 c Descent sub
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3115 grestore
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3116 exch space add exch moveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3117 xt yt
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3118 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3119
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3120 %>Right RePeat: string entry height width rwidth RRP |- x y
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3121 /RRP{begin-repeat right-direction end-repeat}def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3122
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3123 %>Left RePeat: string entry height width rwidth LRP |- x y
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3124 /LRP{begin-repeat left-direction end-repeat}def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3125
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3126 % --- Except
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3127
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3128 % entry height width rwidth begin-except
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3129 /begin-except
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3130 {/rwidth exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3131 /width exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3132 /height exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3133 /entry exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3134 /fE F
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3135 /space SpaceE def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3136 /Effect EffectE def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3137 /shape ShapeE def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3138 /shapecolor BackgroundE def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3139 /borderwidth BorderWidthE def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3140 /bordercolor BorderColorE def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3141 /foreground ForegroundE def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3142 /shadow ShadowE def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3143 xyt
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3144 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3145
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3146 % x-width end-except |- x y
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3147 /end-except
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3148 {gsave
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3149 space space add add Descent rmoveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3150 (-) foreground SetRGB S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3151 grestore
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3152 space 0 rmoveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3153 xt yt
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3154 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3155
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3156 %>Right EXcept: x-width entry height width rwidth REX |- x y
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3157 /REX{begin-except right-direction end-except}def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3158
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3159 %>Left EXcept: x-width entry height width rwidth LEX |- x y
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3160 /LEX{begin-except left-direction end-except}def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3161
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3162 % --- Sequence
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3163
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3164 %>Beginning Of Sequence: BOS |- x y
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3165 /BOS{currentpoint}bind def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3166
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3167 %>End Of Sequence: x y x1 y1 EOS |- x y
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3168 /EOS{pop pop}bind def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3169
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3170 % --- Production
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3171
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3172 %>Beginning Of Production: string width height BOP |- y x
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3173 /BOP
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3174 {xyp
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3175 neg yp add /yw exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3176 xp add T sub /xw exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3177 /Effect EffectP def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3178 /fP F ForegroundP SetRGB BackgroundP aload pop true BG S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3179 /Effect 0 def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3180 ( :) S false BG
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3181 xw yw moveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3182 hT EL RA
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3183 xp yw moveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3184 T EL
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3185 yp xp
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3186 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3187
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3188 %>End Of Production: y x delta EOP
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3189 /EOPH{add exch moveto}bind def % horizontal
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3190 /EOPV{exch pop sub 0 exch moveto}bind def % vertical
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3191
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3192 % --- Empty Alternative
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3193
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3194 %>Empty Alternative: width EA |- x y
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3195 /EA
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3196 {gsave
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3197 Er add 0 rlineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3198 Stroke
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3199 grestore
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3200 c
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3201 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3202
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3203 % --- Alternative
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3204
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3205 %>AlTernative: h1 h2 ... hn n width AT |- x y
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3206 /AT
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3207 {xyo xo add /xw exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3208 xw yo moveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3209 Er EL
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3210 {xw yo moveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3211 dup RAlt
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3212 xo yo moveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3213 LAlt}repeat
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3214 xo yo
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3215 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3216
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3217 % --- Optional
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3218
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3219 %>OPtional: height width OP |- x y
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3220 /OP
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3221 {xyo
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3222 T sub /ow exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3223 ow Er sub 0 rmoveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3224 T Er add EL
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3225 neg dup RAlt
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3226 ow T sub neg EL
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3227 xo yo moveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3228 LAlt
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3229 xo yo moveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3230 T EL
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3231 xo yo
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3232 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3233
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3234 % --- List Flow
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3235
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3236 %>One or More: height width OM |- x y
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3237 /OM
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3238 {xyo
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3239 /ow exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3240 ow Er add 0 rmoveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3241 T Er add neg EL
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3242 dup RLoop
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3243 xo T add yo moveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3244 LLoop
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3245 xo yo moveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3246 T EL
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3247 xo yo
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3248 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3249
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3250 %>Zero or More: h2 h1 width ZM |- x y
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3251 /ZM
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3252 {xyo
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3253 Er add EL
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3254 Er neg 0 rmoveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3255 dup RAlt
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3256 exch dup RLoop
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3257 xo yo moveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3258 exch dup LAlt
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3259 exch LLoop
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3260 yo add xo T add exch moveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3261 xo yo
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3262 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3263
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3264 % === end EBNF engine
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3265
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3266 "
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3267 "EBNF PostScript prologue")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3268
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3269
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3270 (defconst ebnf-eps-prologue
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3271 "
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3272 /#ebnf2ps#dict 230 dict def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3273 #ebnf2ps#dict begin
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3274
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3275 % Initiliaze variables to avoid name-conflicting with document variables.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3276 % This is the case when using `bind' operator.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3277 /-fillp- 0 def /h 0 def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3278 /-ox- 0 def /half 0 def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3279 /-oy- 0 def /height 0 def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3280 /-save- 0 def /ow 0 def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3281 /Ascent 0 def /quarter 0 def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3282 /Descent 0 def /rXX 0 def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3283 /Effect 0 def /rYY 0 def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3284 /FontHeight 0 def /rwidth 0 def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3285 /LineThickness 0 def /rxx 0 def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3286 /OverlinePosition 0 def /ryy 0 def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3287 /SpaceBackground 0 def /shadow 0 def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3288 /StrikeoutPosition 0 def /shape 0 def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3289 /UnderlinePosition 0 def /shapecolor 0 def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3290 /XBox 0 def /space 0 def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3291 /XX 0 def /st 1 string def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3292 /Xshadow 0 def /w 0 def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3293 /YBox 0 def /width 0 def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3294 /YY 0 def /xi 0 def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3295 /Yshadow 0 def /xo 0 def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3296 /arrow 0 def /xp 0 def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3297 /bg false def /xt 0 def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3298 /bgcolor 0 def /xw 0 def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3299 /bordercolor 0 def /xx 0 def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3300 /borderwidth 0 def /yi 0 def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3301 /dd 0 def /yo 0 def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3302 /entry 0 def /yp 0 def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3303 /foreground 0 def /yt 0 def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3304 /yy 0 def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3305
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3306
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3307 % ISOLatin1Encoding stolen from ps_init.ps in GhostScript 2.6.1.4:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3308 /ISOLatin1Encoding where
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3309 {pop}
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3310 {% -- The ISO Latin-1 encoding vector isn't known, so define it.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3311 % -- The first half is the same as the standard encoding,
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3312 % -- except for minus instead of hyphen at code 055.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3313 /ISOLatin1Encoding
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3314 StandardEncoding 0 45 getinterval aload pop
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3315 /minus
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3316 StandardEncoding 46 82 getinterval aload pop
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3317 %*** NOTE: the following are missing in the Adobe documentation,
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3318 %*** but appear in the displayed table:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3319 %*** macron at 0225, dieresis at 0230, cedilla at 0233, space at 0240.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3320 % 0200 (128)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3321 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3322 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3323 /dotlessi /grave /acute /circumflex /tilde /macron /breve /dotaccent
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3324 /dieresis /.notdef /ring /cedilla /.notdef /hungarumlaut /ogonek /caron
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3325 % 0240 (160)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3326 /space /exclamdown /cent /sterling
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3327 /currency /yen /brokenbar /section
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3328 /dieresis /copyright /ordfeminine /guillemotleft
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3329 /logicalnot /hyphen /registered /macron
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3330 /degree /plusminus /twosuperior /threesuperior
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3331 /acute /mu /paragraph /periodcentered
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3332 /cedilla /onesuperior /ordmasculine /guillemotright
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3333 /onequarter /onehalf /threequarters /questiondown
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3334 % 0300 (192)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3335 /Agrave /Aacute /Acircumflex /Atilde
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3336 /Adieresis /Aring /AE /Ccedilla
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3337 /Egrave /Eacute /Ecircumflex /Edieresis
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3338 /Igrave /Iacute /Icircumflex /Idieresis
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3339 /Eth /Ntilde /Ograve /Oacute
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3340 /Ocircumflex /Otilde /Odieresis /multiply
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3341 /Oslash /Ugrave /Uacute /Ucircumflex
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3342 /Udieresis /Yacute /Thorn /germandbls
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3343 % 0340 (224)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3344 /agrave /aacute /acircumflex /atilde
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3345 /adieresis /aring /ae /ccedilla
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3346 /egrave /eacute /ecircumflex /edieresis
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3347 /igrave /iacute /icircumflex /idieresis
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3348 /eth /ntilde /ograve /oacute
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3349 /ocircumflex /otilde /odieresis /divide
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3350 /oslash /ugrave /uacute /ucircumflex
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3351 /udieresis /yacute /thorn /ydieresis
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3352 256 packedarray def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3353 }ifelse
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3354
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3355 /reencodeFontISO %def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3356 {dup
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3357 length 12 add dict % Make a new font (a new dict the same size
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3358 % as the old one) with room for our new symbols.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3359
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3360 begin % Make the new font the current dictionary.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3361 {1 index /FID ne
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3362 {def}{pop pop}ifelse
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3363 }forall % Copy each of the symbols from the old dictionary
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3364 % to the new one except for the font ID.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3365
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3366 currentdict /FontType get 0 ne
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3367 {/Encoding ISOLatin1Encoding def}if % Override the encoding with
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3368 % the ISOLatin1 encoding.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3369
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3370 % Use the font's bounding box to determine the ascent, descent,
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3371 % and overall height; don't forget that these values have to be
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3372 % transformed using the font's matrix.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3373
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3374 % ^ (x2 y2)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3375 % | |
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3376 % | v
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3377 % | +----+ - -
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3378 % | | | ^
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3379 % | | | | Ascent (usually > 0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3380 % | | | |
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3381 % (0 0) -> +--+----+-------->
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3382 % | | |
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3383 % | | v Descent (usually < 0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3384 % (x1 y1) --> +----+ - -
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3385
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3386 currentdict /FontType get 0 ne
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3387 {/FontBBox load aload pop % -- x1 y1 x2 y2
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3388 FontMatrix transform /Ascent exch def pop
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3389 FontMatrix transform /Descent exch def pop}
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3390 {/PrimaryFont FDepVector 0 get def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3391 PrimaryFont /FontBBox get aload pop
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3392 PrimaryFont /FontMatrix get transform /Ascent exch def pop
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3393 PrimaryFont /FontMatrix get transform /Descent exch def pop
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3394 }ifelse
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3395
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3396 /FontHeight Ascent Descent sub def % use `sub' because descent < 0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3397
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3398 % Define these in case they're not in the FontInfo
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3399 % (also, here they're easier to get to).
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3400 /UnderlinePosition Descent 0.70 mul def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3401 /OverlinePosition Descent UnderlinePosition sub Ascent add def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3402 /StrikeoutPosition Ascent 0.30 mul def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3403 /LineThickness FontHeight 0.05 mul def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3404 /Xshadow FontHeight 0.08 mul def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3405 /Yshadow FontHeight -0.09 mul def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3406 /SpaceBackground Descent neg UnderlinePosition add def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3407 /XBox Descent neg def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3408 /YBox LineThickness 0.7 mul def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3409
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3410 currentdict % Leave the new font on the stack
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3411 end % Stop using the font as the current dictionary
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3412 definefont % Put the font into the font dictionary
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3413 pop % Discard the returned font
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3414 }bind def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3415
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3416 % Font definition
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3417 /DefFont{findfont exch scalefont reencodeFontISO}def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3418
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3419 % Font selection
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3420 /F
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3421 {findfont
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3422 dup /Ascent get /Ascent exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3423 dup /Descent get /Descent exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3424 dup /FontHeight get /FontHeight exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3425 dup /UnderlinePosition get /UnderlinePosition exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3426 dup /OverlinePosition get /OverlinePosition exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3427 dup /StrikeoutPosition get /StrikeoutPosition exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3428 dup /LineThickness get /LineThickness exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3429 dup /Xshadow get /Xshadow exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3430 dup /Yshadow get /Yshadow exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3431 dup /SpaceBackground get /SpaceBackground exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3432 dup /XBox get /XBox exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3433 dup /YBox get /YBox exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3434 setfont
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3435 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3436
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3437 /BG
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3438 {dup /bg exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3439 {mark 4 1 roll ]}
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3440 {[ 1.0 1.0 1.0 ]}
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3441 ifelse
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3442 /bgcolor exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3443 }def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3444
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3445 % stack: --
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3446 /FillBgColor{bgcolor aload pop setrgbcolor fill}bind def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3447
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3448 % stack: fill-or-not lower-x lower-y upper-x upper-y |- --
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3449 /doRect
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3450 {/rYY exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3451 /rXX exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3452 /ryy exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3453 /rxx exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3454 gsave
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3455 newpath
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3456 rXX rYY moveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3457 rxx rYY lineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3458 rxx ryy lineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3459 rXX ryy lineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3460 closepath
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3461 % top of stack: fill-or-not
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3462 {FillBgColor}
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3463 {LineThickness setlinewidth stroke}
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3464 ifelse
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3465 grestore
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3466 }bind def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3467
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3468 % stack: string fill-or-not |- --
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3469 /doOutline
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3470 {/-fillp- exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3471 /-ox- currentpoint /-oy- exch def def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3472 gsave
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3473 LineThickness setlinewidth
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3474 {st 0 3 -1 roll put
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3475 st dup true charpath
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3476 -fillp- {gsave FillBgColor grestore}if
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3477 stroke stringwidth
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3478 -oy- add /-oy- exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3479 -ox- add /-ox- exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3480 -ox- -oy- moveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3481 }forall
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3482 grestore
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3483 -ox- -oy- moveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3484 }bind def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3485
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3486 % stack: fill-or-not delta |- --
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3487 /doBox
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3488 {/dd exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3489 xx XBox sub dd sub yy YBox sub dd sub
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3490 XX XBox add dd add YY YBox add dd add
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3491 doRect
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3492 }bind def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3493
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3494 % stack: string |- --
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3495 /doShadow
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3496 {gsave
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3497 Xshadow Yshadow rmoveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3498 false doOutline
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3499 grestore
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3500 }bind def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3501
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3502 % stack: position |- --
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3503 /Hline
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3504 {currentpoint exch pop add dup
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3505 gsave
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3506 newpath
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3507 xx exch moveto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3508 XX exch lineto
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3509 closepath
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3510 LineThickness setlinewidth stroke
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3511 grestore
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3512 }bind def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3513
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3514 % stack: string |- --
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3515 % effect: 1 - underline 2 - strikeout 4 - overline
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3516 % 8 - shadow 16 - box 32 - outline
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3517 /S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3518 {/xx currentpoint dup Descent add /yy exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3519 Ascent add /YY exch def def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3520 dup stringwidth pop xx add /XX exch def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3521 Effect 8 and 0 ne
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3522 {/yy yy Yshadow add def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3523 /XX XX Xshadow add def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3524 }if
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3525 bg
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3526 {true
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3527 Effect 16 and 0 ne
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3528 {SpaceBackground doBox}
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3529 {xx yy XX YY doRect}
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3530 ifelse
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3531 }if % background
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3532 Effect 16 and 0 ne{false 0 doBox}if % box
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3533 Effect 8 and 0 ne{dup doShadow}if % shadow
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3534 Effect 32 and 0 ne
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3535 {true doOutline} % outline
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3536 {show} % normal text
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3537 ifelse
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3538 Effect 1 and 0 ne{UnderlinePosition Hline}if % underline
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3539 Effect 2 and 0 ne{StrikeoutPosition Hline}if % strikeout
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3540 Effect 4 and 0 ne{OverlinePosition Hline}if % overline
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3541 }bind def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3542
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3543 "
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3544 "EBNF EPS prologue")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3545
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3546
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3547 (defconst ebnf-eps-begin
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3548 "
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3549 end
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3550
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3551 % x y #ebnf2ps#begin
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3552 /#ebnf2ps#begin
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3553 {#ebnf2ps#dict begin /#ebnf2ps#save save def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3554 moveto false BG 0.0 0.0 0.0 setrgbcolor}def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3555
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3556 /#ebnf2ps#end{showpage #ebnf2ps#save restore end}def
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3557
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3558 %%EndPrologue
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3559 "
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3560 "EBNF EPS begin")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3561
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3562
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3563 (defconst ebnf-eps-end
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3564 "#ebnf2ps#end
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3565 %%EOF
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3566 "
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3567 "EBNF EPS end")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3568
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3569
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3570 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3571 ;; Formatting
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3572
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3573
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3574 (defvar ebnf-format-float "%1.3f")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3575
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3576
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3577 (defun ebnf-format-float (&rest floats)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3578 (mapconcat
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3579 #'(lambda (float)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3580 (format ebnf-format-float float))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3581 floats
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3582 " "))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3583
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3584
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3585 (defun ebnf-format-color (format-str color default)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3586 (let* ((the-color (or color default))
30552
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
3587 (rgb (ps-color-scale the-color)))
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3588 (format format-str
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3589 (concat "["
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3590 (ebnf-format-float (nth 0 rgb) (nth 1 rgb) (nth 2 rgb))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3591 "]")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3592 the-color)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3593
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3594
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3595 (defvar ebnf-message-float "%3.2f")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3596
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3597
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3598 (defsubst ebnf-message-float (format-str value)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3599 (message format-str
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3600 (format ebnf-message-float value)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3601
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3602
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3603 (defsubst ebnf-message-info (messag)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3604 (message "%s...%3d%%"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3605 messag
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3606 (round (/ (* (setq ebnf-nprod (1+ ebnf-nprod)) 100.0) ebnf-total))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3607
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3608
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3609 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3610 ;; Macros
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3611
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3612
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3613 (defmacro ebnf-node-kind (vec &optional value)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3614 (if value
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3615 `(aset ,vec 0 ,value)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3616 `(aref ,vec 0)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3617
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3618
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3619 (defmacro ebnf-node-width-func (node width)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3620 `(funcall (aref ,node 1) ,node ,width))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3621
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3622
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3623 (defmacro ebnf-node-dimension-func (node &optional value)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3624 (if value
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3625 `(aset ,node 2 ,value)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3626 `(funcall (aref ,node 2) ,node)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3627
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3628
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3629 (defmacro ebnf-node-entry (vec &optional value)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3630 (if value
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3631 `(aset ,vec 3 ,value)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3632 `(aref ,vec 3)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3633
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3634
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3635 (defmacro ebnf-node-height (vec &optional value)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3636 (if value
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3637 `(aset ,vec 4 ,value)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3638 `(aref ,vec 4)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3639
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3640
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3641 (defmacro ebnf-node-width (vec &optional value)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3642 (if value
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3643 `(aset ,vec 5 ,value)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3644 `(aref ,vec 5)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3645
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3646
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3647 (defmacro ebnf-node-name (vec)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3648 `(aref ,vec 6))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3649
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3650
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3651 (defmacro ebnf-node-list (vec &optional value)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3652 (if value
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3653 `(aset ,vec 6 ,value)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3654 `(aref ,vec 6)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3655
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3656
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3657 (defmacro ebnf-node-default (vec)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3658 `(aref ,vec 7))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3659
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3660
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3661 (defmacro ebnf-node-production (vec &optional value)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3662 (if value
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3663 `(aset ,vec 7 ,value)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3664 `(aref ,vec 7)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3665
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3666
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3667 (defmacro ebnf-node-separator (vec &optional value)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3668 (if value
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3669 `(aset ,vec 7 ,value)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3670 `(aref ,vec 7)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3671
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3672
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3673 (defmacro ebnf-node-action (vec &optional value)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3674 (if value
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3675 `(aset ,vec 8 ,value)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3676 `(aref ,vec 8)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3677
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3678
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3679 (defmacro ebnf-node-generation (node)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3680 `(funcall (ebnf-node-kind ,node) ,node))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3681
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3682
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3683 (defmacro ebnf-max-width (prod)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3684 `(max (ebnf-node-width ,prod)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3685 (+ (* (length (ebnf-node-name ,prod))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3686 ebnf-font-width-P)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3687 ebnf-production-horizontal-space)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3688
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3689
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3690 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3691 ;; PostScript generation
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3692
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3693
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3694 (defun ebnf-generate-eps (ebnf-tree)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3695 (let* ((ps-color-p (and ebnf-color-p (ps-color-device)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3696 (ps-print-color-scale (if ps-color-p
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3697 (float (car (ps-color-values "white")))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3698 1.0))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3699 (ebnf-total (length ebnf-tree))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3700 (ebnf-nprod 0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3701 (old-ps-output (symbol-function 'ps-output))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3702 (old-ps-output-string (symbol-function 'ps-output-string))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3703 (eps-buffer (get-buffer-create ebnf-eps-buffer-name))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3704 ebnf-debug-ps error-msg horizontal
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3705 prod prod-name prod-width prod-height prod-list file-list)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3706 ;; redefines `ps-output' and `ps-output-string'
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3707 (defalias 'ps-output 'ebnf-eps-output)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3708 (defalias 'ps-output-string 'ps-output-string-prim)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3709 ;; generate EPS file
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3710 (save-excursion
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3711 (condition-case data
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3712 (progn
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3713 (while ebnf-tree
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3714 (setq prod (car ebnf-tree)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3715 prod-name (ebnf-node-name prod)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3716 prod-width (ebnf-max-width prod)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3717 prod-height (ebnf-node-height prod)
30552
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
3718 horizontal (memq (ebnf-node-action prod)
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
3719 ebnf-action-list))
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3720 ;; generate production in EPS buffer
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3721 (save-excursion
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3722 (set-buffer eps-buffer)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3723 (setq ebnf-eps-upper-x 0.0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3724 ebnf-eps-upper-y 0.0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3725 ebnf-eps-max-width prod-width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3726 ebnf-eps-max-height prod-height)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3727 (ebnf-generate-production prod))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3728 (if (setq prod-list (cdr (assoc prod-name
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3729 ebnf-eps-production-list)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3730 ;; insert EPS buffer in all buffer associated with production
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3731 (ebnf-eps-production-list prod-list 'file-list horizontal
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3732 prod-width prod-height eps-buffer)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3733 ;; write EPS file for production
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3734 (ebnf-eps-finish-and-write eps-buffer
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3735 (ebnf-eps-filename prod-name)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3736 ;; prepare for next loop
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3737 (save-excursion
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3738 (set-buffer eps-buffer)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3739 (erase-buffer))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3740 (setq ebnf-tree (cdr ebnf-tree)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3741 ;; write and kill temporary buffers
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3742 (ebnf-eps-write-kill-temp file-list t)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3743 (setq file-list nil))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3744 ;; handler
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3745 ((quit error)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3746 (setq error-msg (error-message-string data)))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3747 ;; restore `ps-output' and `ps-output-string'
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3748 (defalias 'ps-output old-ps-output)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3749 (defalias 'ps-output-string old-ps-output-string)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3750 ;; kill temporary buffers
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3751 (kill-buffer eps-buffer)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3752 (ebnf-eps-write-kill-temp file-list nil)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3753 (and error-msg (error error-msg))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3754 (message " ")))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3755
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3756
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3757 ;; write and kill temporary buffers
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3758 (defun ebnf-eps-write-kill-temp (file-list write-p)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3759 (while file-list
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3760 (let ((buffer (get-buffer (concat " *" (car file-list) "*"))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3761 (when buffer
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3762 (and write-p
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3763 (ebnf-eps-finish-and-write buffer (car file-list)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3764 (kill-buffer buffer)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3765 (setq file-list (cdr file-list))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3766
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3767
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3768 ;; insert EPS buffer in all buffer associated with production
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3769 (defun ebnf-eps-production-list (prod-list file-list-sym horizontal
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3770 prod-width prod-height eps-buffer)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3771 (while prod-list
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3772 (add-to-list file-list-sym (car prod-list))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3773 (save-excursion
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3774 (set-buffer (get-buffer-create (concat " *" (car prod-list) "*")))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3775 (goto-char (point-max))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3776 (cond
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3777 ;; first production
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3778 ((zerop (buffer-size))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3779 (setq ebnf-eps-upper-x 0.0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3780 ebnf-eps-upper-y 0.0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3781 ebnf-eps-max-width prod-width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3782 ebnf-eps-max-height prod-height))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3783 ;; horizontal
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3784 (horizontal
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3785 (ebnf-eop-horizontal ebnf-eps-prod-width)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3786 (setq ebnf-eps-max-width (+ ebnf-eps-max-width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3787 ebnf-production-horizontal-space
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3788 prod-width)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3789 ebnf-eps-max-height (max ebnf-eps-max-height prod-height)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3790 ;; vertical
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3791 (t
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3792 (ebnf-eop-vertical ebnf-eps-max-height)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3793 (setq ebnf-eps-upper-x (max ebnf-eps-upper-x ebnf-eps-max-width)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3794 ebnf-eps-upper-y (if (zerop ebnf-eps-upper-y)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3795 ebnf-eps-max-height
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3796 (+ ebnf-eps-upper-y
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3797 ebnf-production-vertical-space
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3798 ebnf-eps-max-height))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3799 ebnf-eps-max-width prod-width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3800 ebnf-eps-max-height prod-height))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3801 )
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3802 (setq ebnf-eps-prod-width prod-width)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3803 (insert-buffer eps-buffer))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3804 (setq prod-list (cdr prod-list))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3805
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3806
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3807 (defun ebnf-generate (ebnf-tree)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3808 (let* ((ps-color-p (and ebnf-color-p (ps-color-device)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3809 (ps-print-color-scale (if ps-color-p
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3810 (float (car (ps-color-values "white")))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3811 1.0))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3812 ps-zebra-stripes ps-line-number ps-razzle-dazzle
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3813 ps-print-hook
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3814 ps-print-begin-sheet-hook
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3815 ps-print-begin-page-hook
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3816 ps-print-begin-column-hook)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3817 (ps-generate (current-buffer) (point-min) (point-max)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3818 'ebnf-generate-postscript)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3819
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3820
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3821 (defvar ebnf-tree nil)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3822 (defvar ebnf-direction "R")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3823 (defvar ebnf-total 0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3824 (defvar ebnf-nprod 0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3825
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3826
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3827 (defun ebnf-generate-postscript (from to)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3828 (ebnf-begin-file)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3829 (if ebnf-horizontal-max-height
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3830 (ebnf-generate-with-max-height)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3831 (ebnf-generate-without-max-height))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3832 (message " "))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3833
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3834
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3835 (defun ebnf-generate-with-max-height ()
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3836 (let ((ebnf-total (length ebnf-tree))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3837 (ebnf-nprod 0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3838 next-line max-height prod the-width)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3839 (while ebnf-tree
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3840 ;; find next line point
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3841 (setq next-line ebnf-tree
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3842 prod (car ebnf-tree)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3843 max-height (ebnf-node-height prod))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3844 (ebnf-begin-line prod (ebnf-max-width prod))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3845 (while (and (setq next-line (cdr next-line))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3846 (setq prod (car next-line))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3847 (memq (ebnf-node-action prod) ebnf-action-list)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3848 (setq the-width (ebnf-max-width prod))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3849 (<= the-width ps-width-remaining))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3850 (setq max-height (max max-height (ebnf-node-height prod))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3851 ps-width-remaining (- ps-width-remaining
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3852 (+ the-width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3853 ebnf-production-horizontal-space))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3854 ;; generate current line
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3855 (ebnf-newline max-height)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3856 (setq prod (car ebnf-tree))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3857 (ebnf-generate-production prod)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3858 (while (not (eq (setq ebnf-tree (cdr ebnf-tree)) next-line))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3859 (ebnf-eop-horizontal (ebnf-max-width prod))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3860 (setq prod (car ebnf-tree))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3861 (ebnf-generate-production prod))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3862 (ebnf-eop-vertical max-height))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3863
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3864
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3865 (defun ebnf-generate-without-max-height ()
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3866 (let ((ebnf-total (length ebnf-tree))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3867 (ebnf-nprod 0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3868 max-height prod bef-width cur-width)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3869 (while ebnf-tree
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3870 ;; generate current line
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3871 (setq prod (car ebnf-tree)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3872 max-height (ebnf-node-height prod)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3873 bef-width (ebnf-max-width prod))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3874 (ebnf-begin-line prod bef-width)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3875 (ebnf-generate-production prod)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3876 (while (and (setq ebnf-tree (cdr ebnf-tree))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3877 (setq prod (car ebnf-tree))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3878 (memq (ebnf-node-action prod) ebnf-action-list)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3879 (setq cur-width (ebnf-max-width prod))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3880 (<= cur-width ps-width-remaining)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3881 (<= (ebnf-node-height prod) ps-height-remaining))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3882 (ebnf-eop-horizontal bef-width)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3883 (ebnf-generate-production prod)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3884 (setq bef-width cur-width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3885 max-height (max max-height (ebnf-node-height prod))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3886 ps-width-remaining (- ps-width-remaining
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3887 (+ cur-width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3888 ebnf-production-horizontal-space))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3889 (ebnf-eop-vertical max-height)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3890 ;; prepare next line
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3891 (ebnf-newline max-height))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3892
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3893
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3894 (defun ebnf-begin-line (prod width)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3895 (and (or (eq (ebnf-node-action prod) 'form-feed)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3896 (> (ebnf-node-height prod) ps-height-remaining))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3897 (ebnf-new-page))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3898 (setq ps-width-remaining (- ps-width-remaining
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3899 (+ width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3900 ebnf-production-horizontal-space))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3901
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3902
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3903 (defun ebnf-newline (height)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3904 (and (> height ps-height-remaining)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3905 (ebnf-new-page))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3906 (setq ps-width-remaining ps-print-width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3907 ps-height-remaining (- ps-height-remaining
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3908 (+ height
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3909 ebnf-production-vertical-space))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3910
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3911
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3912 ;; [production width-fun dim-fun entry height width name production action]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3913 (defun ebnf-generate-production (production)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3914 (ebnf-message-info "Generating")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3915 (run-hooks 'ebnf-production-hook)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3916 (ps-output-string (ebnf-node-name production))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3917 (ps-output " "
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3918 (ebnf-format-float
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3919 (ebnf-node-width production)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3920 (+ ebnf-basic-height
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3921 (ebnf-node-entry (ebnf-node-production production))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3922 " BOP\n")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3923 (ebnf-node-generation (ebnf-node-production production))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3924 (ps-output "EOS\n"))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3925
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3926
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3927 ;; [alternative width-fun dim-fun entry height width list]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3928 (defun ebnf-generate-alternative (alternative)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3929 (let ((alt (ebnf-node-list alternative))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3930 (entry (ebnf-node-entry alternative))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3931 (nlist 0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3932 alt-height alt-entry)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3933 (while alt
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3934 (ps-output (ebnf-format-float (- entry (ebnf-node-entry (car alt))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3935 " ")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3936 (setq entry (- entry (ebnf-node-height (car alt)) ebnf-vertical-space)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3937 nlist (1+ nlist)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3938 alt (cdr alt)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3939 (ps-output (format "%d " nlist)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3940 (ebnf-format-float (ebnf-node-width alternative))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3941 " AT\n")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3942 (setq alt (ebnf-node-list alternative))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3943 (when alt
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3944 (ebnf-node-generation (car alt))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3945 (setq alt-height (- (ebnf-node-height (car alt))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3946 (ebnf-node-entry (car alt)))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3947 (while (setq alt (cdr alt))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3948 (setq alt-entry (ebnf-node-entry (car alt)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3949 (ebnf-vertical-movement
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3950 (- (+ alt-height ebnf-vertical-space alt-entry)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3951 (ebnf-node-generation (car alt))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3952 (setq alt-height (- (ebnf-node-height (car alt)) alt-entry))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3953 (ps-output "EOS\n"))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3954
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3955
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3956 ;; [sequence width-fun dim-fun entry height width list]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3957 (defun ebnf-generate-sequence (sequence)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3958 (ps-output "BOS\n")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3959 (let ((seq (ebnf-node-list sequence))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3960 seq-width)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3961 (when seq
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3962 (ebnf-node-generation (car seq))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3963 (setq seq-width (ebnf-node-width (car seq))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3964 (while (setq seq (cdr seq))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3965 (ebnf-horizontal-movement seq-width)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3966 (ebnf-node-generation (car seq))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3967 (setq seq-width (ebnf-node-width (car seq)))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3968 (ps-output "EOS\n"))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3969
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3970
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3971 ;; [terminal width-fun dim-fun entry height width name]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3972 (defun ebnf-generate-terminal (terminal)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3973 (ebnf-gen-terminal terminal "T"))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3974
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3975
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3976 ;; [non-terminal width-fun dim-fun entry height width name]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3977 (defun ebnf-generate-non-terminal (non-terminal)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3978 (ebnf-gen-terminal non-terminal "NT"))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3979
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3980
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3981 ;; [empty width-fun dim-fun entry height width]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3982 (defun ebnf-generate-empty (empty)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3983 (ebnf-empty-alternative (ebnf-node-width empty)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3984
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3985
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3986 ;; [optional width-fun dim-fun entry height width element]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3987 (defun ebnf-generate-optional (optional)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3988 (let ((the-optional (ebnf-node-list optional)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3989 (ps-output (ebnf-format-float
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3990 (+ (- (ebnf-node-height the-optional)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3991 (ebnf-node-entry optional))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3992 ebnf-vertical-space)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3993 (ebnf-node-width optional))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3994 " OP\n")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3995 (ebnf-node-generation the-optional)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3996 (ps-output "EOS\n")))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3997
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3998
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3999 ;; [one-or-more width-fun dim-fun entry height width element separator]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4000 (defun ebnf-generate-one-or-more (one-or-more)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4001 (let* ((width (ebnf-node-width one-or-more))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4002 (sep (ebnf-node-separator one-or-more))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4003 (entry (- (ebnf-node-entry one-or-more)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4004 (if sep
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4005 (ebnf-node-entry sep)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4006 0))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4007 (ps-output (ebnf-format-float entry width)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4008 " OM\n")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4009 (ebnf-node-generation (ebnf-node-list one-or-more))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4010 (ebnf-vertical-movement entry)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4011 (if sep
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4012 (let ((ebnf-direction "L"))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4013 (ebnf-node-generation sep))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4014 (ebnf-empty-alternative (- width ebnf-horizontal-space))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4015 (ps-output "EOS\n"))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4016
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4017
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4018 ;; [zero-or-more width-fun dim-fun entry height width element separator]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4019 (defun ebnf-generate-zero-or-more (zero-or-more)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4020 (let* ((width (ebnf-node-width zero-or-more))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4021 (node-list (ebnf-node-list zero-or-more))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4022 (list-entry (ebnf-node-entry node-list))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4023 (node-sep (ebnf-node-separator zero-or-more))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4024 (entry (+ list-entry
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4025 ebnf-vertical-space
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4026 (if node-sep
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4027 (- (ebnf-node-height node-sep)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4028 (ebnf-node-entry node-sep))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4029 0))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4030 (ps-output (ebnf-format-float entry
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4031 (+ (- (ebnf-node-height node-list)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4032 list-entry)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4033 ebnf-vertical-space)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4034 width)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4035 " ZM\n")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4036 (ebnf-node-generation (ebnf-node-list zero-or-more))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4037 (ebnf-vertical-movement entry)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4038 (if (ebnf-node-separator zero-or-more)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4039 (let ((ebnf-direction "L"))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4040 (ebnf-node-generation (ebnf-node-separator zero-or-more)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4041 (ebnf-empty-alternative (- width ebnf-horizontal-space))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4042 (ps-output "EOS\n"))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4043
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4044
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4045 ;; [special width-fun dim-fun entry height width name]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4046 (defun ebnf-generate-special (special)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4047 (ebnf-gen-terminal special "SP"))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4048
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4049
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4050 ;; [repeat width-fun dim-fun entry height width times element]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4051 (defun ebnf-generate-repeat (repeat)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4052 (let ((times (ebnf-node-name repeat))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4053 (element (ebnf-node-separator repeat)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4054 (ps-output-string times)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4055 (ps-output " "
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4056 (ebnf-format-float
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4057 (ebnf-node-entry repeat)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4058 (ebnf-node-height repeat)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4059 (ebnf-node-width repeat)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4060 (if element
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4061 (+ (ebnf-node-width element)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4062 ebnf-space-R ebnf-space-R ebnf-space-R
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4063 (* (length times) ebnf-font-width-R))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4064 0.0))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4065 " " ebnf-direction "RP\n")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4066 (and element
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4067 (ebnf-node-generation element)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4068 (ps-output "EOS\n"))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4069
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4070
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4071 ;; [except width-fun dim-fun entry height width element element]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4072 (defun ebnf-generate-except (except)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4073 (let* ((element (ebnf-node-list except))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4074 (exception (ebnf-node-separator except))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4075 (width (ebnf-node-width element)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4076 (ps-output (ebnf-format-float
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4077 width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4078 (ebnf-node-entry except)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4079 (ebnf-node-height except)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4080 (ebnf-node-width except)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4081 (+ width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4082 ebnf-space-E ebnf-space-E ebnf-space-E
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4083 ebnf-font-width-E
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4084 (if exception
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4085 (+ (ebnf-node-width exception) ebnf-space-E)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4086 0.0)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4087 " " ebnf-direction "EX\n")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4088 (ebnf-node-generation (ebnf-node-list except))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4089 (when exception
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4090 (ebnf-horizontal-movement (+ width ebnf-space-E
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4091 ebnf-font-width-E ebnf-space-E))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4092 (ebnf-node-generation exception)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4093 (ps-output "EOS\n"))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4094
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4095
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4096 (defun ebnf-gen-terminal (node code)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4097 (ps-output-string (ebnf-node-name node))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4098 (ps-output " " (ebnf-format-float (ebnf-node-width node))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4099 " " ebnf-direction code
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4100 (if (ebnf-node-default node)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4101 "D\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4102 "\n")))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4103
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4104
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4105 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4106 ;; Internal functions
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4107
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4108
34803
de1f65fa5dcd Fix a problem with skip-chars-forward: it doesn't accept
Gerd Moellmann <gerd@gnu.org>
parents: 31255
diff changeset
4109 ;; function `ebnf-range-regexp' is used to avoid a bug of `skip-chars-forward'
de1f65fa5dcd Fix a problem with skip-chars-forward: it doesn't accept
Gerd Moellmann <gerd@gnu.org>
parents: 31255
diff changeset
4110 ;; on version 20.4.1, that is, it doesn't accept ranges like "\240-\377" (or
de1f65fa5dcd Fix a problem with skip-chars-forward: it doesn't accept
Gerd Moellmann <gerd@gnu.org>
parents: 31255
diff changeset
4111 ;; "\177-\237"), but it accepts the character sequence from \240 to \377 (or
de1f65fa5dcd Fix a problem with skip-chars-forward: it doesn't accept
Gerd Moellmann <gerd@gnu.org>
parents: 31255
diff changeset
4112 ;; from \177 to \237). It seems that version 20.7 has the same problem.
de1f65fa5dcd Fix a problem with skip-chars-forward: it doesn't accept
Gerd Moellmann <gerd@gnu.org>
parents: 31255
diff changeset
4113 (defun ebnf-range-regexp (prefix from to)
de1f65fa5dcd Fix a problem with skip-chars-forward: it doesn't accept
Gerd Moellmann <gerd@gnu.org>
parents: 31255
diff changeset
4114 (let (str)
de1f65fa5dcd Fix a problem with skip-chars-forward: it doesn't accept
Gerd Moellmann <gerd@gnu.org>
parents: 31255
diff changeset
4115 (while (<= from to)
de1f65fa5dcd Fix a problem with skip-chars-forward: it doesn't accept
Gerd Moellmann <gerd@gnu.org>
parents: 31255
diff changeset
4116 (setq str (concat str (char-to-string from))
de1f65fa5dcd Fix a problem with skip-chars-forward: it doesn't accept
Gerd Moellmann <gerd@gnu.org>
parents: 31255
diff changeset
4117 from (1+ from)))
de1f65fa5dcd Fix a problem with skip-chars-forward: it doesn't accept
Gerd Moellmann <gerd@gnu.org>
parents: 31255
diff changeset
4118 (concat prefix str)))
de1f65fa5dcd Fix a problem with skip-chars-forward: it doesn't accept
Gerd Moellmann <gerd@gnu.org>
parents: 31255
diff changeset
4119
de1f65fa5dcd Fix a problem with skip-chars-forward: it doesn't accept
Gerd Moellmann <gerd@gnu.org>
parents: 31255
diff changeset
4120
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4121 (defvar ebnf-map-name
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4122 (let ((map (make-vector 256 ?\_)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4123 (mapcar #'(lambda (char)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4124 (aset map char char))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4125 (concat "#$%&+-.0123456789=?@~"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4126 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4127 "abcdefghijklmnopqrstuvwxyz"))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4128 map))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4129
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4130
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4131 (defun ebnf-eps-filename (str)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4132 (let* ((len (length str))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4133 (stri 0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4134 (new (make-string len ?\ )))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4135 (while (< stri len)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4136 (aset new stri (aref ebnf-map-name (aref str stri)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4137 (setq stri (1+ stri)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4138 (concat ebnf-eps-prefix new ".eps")))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4139
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4140
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4141 (defun ebnf-eps-output (&rest args)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4142 (while args
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4143 (insert (car args))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4144 (setq args (cdr args))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4145
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4146
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4147 (defun ebnf-generate-region (from to gen-func)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4148 (run-hooks 'ebnf-hook)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4149 (let ((ebnf-limit (max from to))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4150 the-point)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4151 (save-excursion
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4152 (save-restriction
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4153 (save-match-data
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4154 (condition-case data
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4155 (let ((tree (ebnf-parse-and-sort (min from to))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4156 (when gen-func
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4157 (funcall gen-func
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4158 (ebnf-dimensions
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4159 (ebnf-optimize
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4160 (ebnf-eliminate-empty-rules tree))))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4161 ;; handler
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4162 ((quit error)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4163 (ding)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4164 (setq the-point (max (1- (point)) (point-min)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4165 (message (error-message-string data)))))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4166 (cond
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4167 (the-point
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4168 (goto-char the-point))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4169 (gen-func
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4170 nil)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4171 (t
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4172 (message "EBNF syntatic analysis: NO ERRORS.")))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4173
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4174
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4175 (defun ebnf-parse-and-sort (start)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4176 (ebnf-begin-job)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4177 (let ((tree (funcall ebnf-parser-func start)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4178 (if ebnf-sort-production
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4179 (progn
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4180 (message "Sorting...")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4181 (sort tree
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4182 (if (eq ebnf-sort-production 'ascending)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4183 'ebnf-sorter-ascending
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4184 'ebnf-sorter-descending)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4185 (nreverse tree))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4186
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4187
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4188 (defun ebnf-sorter-ascending (first second)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4189 (string< (ebnf-node-name first)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4190 (ebnf-node-name second)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4191
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4192
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4193 (defun ebnf-sorter-descending (first second)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4194 (string< (ebnf-node-name second)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4195 (ebnf-node-name first)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4196
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4197
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4198 (defun ebnf-empty-alternative (width)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4199 (ps-output (ebnf-format-float width) " EA\n"))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4200
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4201
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4202 (defun ebnf-vertical-movement (height)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4203 (ps-output (ebnf-format-float height) " vm\n"))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4204
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4205
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4206 (defun ebnf-horizontal-movement (width)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4207 (ps-output (ebnf-format-float width) " hm\n"))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4208
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4209
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4210 (defun ebnf-entry (height)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4211 (* height ebnf-entry-percentage))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4212
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4213
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4214 (defun ebnf-eop-vertical (height)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4215 (ps-output (ebnf-format-float (+ height ebnf-production-vertical-space))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4216 " EOPV\n\n"))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4217
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4218
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4219 (defun ebnf-eop-horizontal (width)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4220 (ps-output (ebnf-format-float (+ width ebnf-production-horizontal-space))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4221 " EOPH\n\n"))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4222
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4223
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4224 (defun ebnf-new-page ()
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4225 (when (< ps-height-remaining ps-print-height)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4226 (run-hooks 'ebnf-page-hook)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4227 (ps-next-page)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4228 (ps-output "\n")))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4229
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4230
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4231 (defsubst ebnf-font-size (font) (nth 0 font))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4232 (defsubst ebnf-font-name (font) (nth 1 font))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4233 (defsubst ebnf-font-foreground (font) (nth 2 font))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4234 (defsubst ebnf-font-background (font) (nth 3 font))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4235 (defsubst ebnf-font-list (font) (nthcdr 4 font))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4236 (defsubst ebnf-font-attributes (font)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4237 (lsh (ps-extension-bit (cdr font)) -2))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4238
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4239
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4240 (defconst ebnf-font-name-select
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4241 (vector 'normal 'bold 'italic 'bold-italic))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4242
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4243
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4244 (defun ebnf-font-name-select (font)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4245 (let* ((font-list (ebnf-font-list font))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4246 (font-index (+ (if (memq 'bold font-list) 1 0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4247 (if (memq 'italic font-list) 2 0)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4248 (name (ebnf-font-name font))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4249 (database (cdr (assoc name ps-font-info-database)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4250 (info-list (or (cdr (assoc 'fonts database))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4251 (error "Invalid font: %s" name))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4252 (or (cdr (assoc (aref ebnf-font-name-select font-index)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4253 info-list))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4254 (error "Invalid attributes for font %s" name))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4255
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4256
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4257 (defun ebnf-font-select (font select)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4258 (let* ((name (ebnf-font-name font))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4259 (database (cdr (assoc name ps-font-info-database)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4260 (size (cdr (assoc 'size database)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4261 (base (cdr (assoc select database))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4262 (if (and size base)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4263 (/ (* (ebnf-font-size font) base)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4264 size)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4265 (error "Invalid font: %s" name))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4266
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4267
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4268 (defsubst ebnf-font-width (font)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4269 (ebnf-font-select font 'avg-char-width))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4270 (defsubst ebnf-font-height (font)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4271 (ebnf-font-select font 'line-height))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4272
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4273
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4274 (defun ebnf-begin-job ()
30552
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
4275 (ps-printing-region nil nil)
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4276 (if ebnf-use-float-format
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4277 (setq ebnf-format-float "%1.3f"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4278 ebnf-message-float "%3.2f")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4279 (setq ebnf-format-float "%s"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4280 ebnf-message-float "%s"))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4281 (ebnf-otz-initialize)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4282 ;; to avoid compilation gripes when calling autoloaded functions
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4283 (funcall (cond ((eq ebnf-syntax 'iso-ebnf)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4284 (setq ebnf-parser-func 'ebnf-iso-parser)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4285 'ebnf-iso-initialize)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4286 ((eq ebnf-syntax 'yacc)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4287 (setq ebnf-parser-func 'ebnf-yac-parser)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4288 'ebnf-yac-initialize)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4289 (t
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4290 (setq ebnf-parser-func 'ebnf-bnf-parser)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4291 'ebnf-bnf-initialize)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4292 (and ebnf-terminal-regexp ; ensures that it's a string or nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4293 (not (stringp ebnf-terminal-regexp))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4294 (setq ebnf-terminal-regexp nil))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4295 (or (and ebnf-eps-prefix ; ensures that it's a string
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4296 (stringp ebnf-eps-prefix))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4297 (setq ebnf-eps-prefix "ebnf--"))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4298 (setq ebnf-entry-percentage ; ensures value between 0.0 and 1.0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4299 (min (max ebnf-entry-percentage 0.0) 1.0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4300 ebnf-action-list (if ebnf-horizontal-orientation
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4301 '(nil keep-line)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4302 '(keep-line))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4303 ebnf-settings nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4304 ebnf-fonts-required nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4305 ebnf-action nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4306 ebnf-default-p nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4307 ebnf-eps-context nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4308 ebnf-eps-production-list nil
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4309 ebnf-eps-upper-x 0.0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4310 ebnf-eps-upper-y 0.0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4311 ebnf-font-height-P (ebnf-font-height ebnf-production-font)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4312 ebnf-font-height-T (ebnf-font-height ebnf-terminal-font)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4313 ebnf-font-height-NT (ebnf-font-height ebnf-non-terminal-font)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4314 ebnf-font-height-S (ebnf-font-height ebnf-special-font)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4315 ebnf-font-height-E (ebnf-font-height ebnf-except-font)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4316 ebnf-font-height-R (ebnf-font-height ebnf-repeat-font)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4317 ebnf-font-width-P (ebnf-font-width ebnf-production-font)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4318 ebnf-font-width-T (ebnf-font-width ebnf-terminal-font)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4319 ebnf-font-width-NT (ebnf-font-width ebnf-non-terminal-font)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4320 ebnf-font-width-S (ebnf-font-width ebnf-special-font)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4321 ebnf-font-width-E (ebnf-font-width ebnf-except-font)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4322 ebnf-font-width-R (ebnf-font-width ebnf-repeat-font)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4323 ebnf-space-T (* ebnf-font-height-T 0.5)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4324 ebnf-space-NT (* ebnf-font-height-NT 0.5)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4325 ebnf-space-S (* ebnf-font-height-S 0.5)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4326 ebnf-space-E (* ebnf-font-height-E 0.5)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4327 ebnf-space-R (* ebnf-font-height-R 0.5))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4328 (let ((basic (+ ebnf-font-height-T ebnf-font-height-NT)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4329 (setq ebnf-basic-width (* basic 0.5)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4330 ebnf-horizontal-space (+ basic basic)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4331 ebnf-basic-height ebnf-basic-width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4332 ebnf-vertical-space ebnf-basic-width)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4333 ;; ensures value is greater than zero
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4334 (or (and (numberp ebnf-production-horizontal-space)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4335 (> ebnf-production-horizontal-space 0.0))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4336 (setq ebnf-production-horizontal-space basic))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4337 ;; ensures value is greater than zero
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4338 (or (and (numberp ebnf-production-vertical-space)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4339 (> ebnf-production-vertical-space 0.0))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4340 (setq ebnf-production-vertical-space basic))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4341
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4342
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4343 (defsubst ebnf-shape-value (sym alist)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4344 (or (cdr (assq sym alist)) 0))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4345
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4346
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4347 (defsubst ebnf-boolean (value)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4348 (if value "true" "false"))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4349
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4350
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4351 (defun ebnf-begin-file ()
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4352 (ps-flush-output)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4353 (save-excursion
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4354 (set-buffer ps-spool-buffer)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4355 (goto-char (point-min))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4356 (and (search-forward "%%Creator: " nil t)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4357 (not (search-forward "& ebnf2ps v"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4358 (save-excursion (end-of-line) (point))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4359 t))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4360 (progn
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4361 ;; adjust creator comment
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4362 (end-of-line)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4363 (backward-char)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4364 (insert " & ebnf2ps v" ebnf-version)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4365 ;; insert ebnf settings & engine
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4366 (goto-char (point-max))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4367 (search-backward "\n%%EndPrologue\n")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4368 (ebnf-insert-ebnf-prologue)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4369 (ps-output "\n")))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4370
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4371
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4372 (defun ebnf-eps-finish-and-write (buffer filename)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4373 (save-excursion
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4374 (set-buffer buffer)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4375 (setq ebnf-eps-upper-x (max ebnf-eps-upper-x ebnf-eps-max-width)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4376 ebnf-eps-upper-y (if (zerop ebnf-eps-upper-y)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4377 ebnf-eps-max-height
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4378 (+ ebnf-eps-upper-y
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4379 ebnf-production-vertical-space
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4380 ebnf-eps-max-height)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4381 ;; prologue
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4382 (goto-char (point-min))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4383 (insert
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4384 "%!PS-Adobe-3.0 EPSF-3.0"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4385 "\n%%BoundingBox: 0 0 "
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4386 (format "%d %d" (1+ ebnf-eps-upper-x) (1+ ebnf-eps-upper-y))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4387 "\n%%Title: " filename
35888
c2604e531b66 Eliminate time-stamp functions.
Gerd Moellmann <gerd@gnu.org>
parents: 34803
diff changeset
4388 "\n%%CreationDate: " (format-time-string "%T %b %d %Y")
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4389 "\n%%Creator: " (user-full-name) " (using ebnf2ps v" ebnf-version ")"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4390 "\n%%DocumentNeededResources: font "
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4391 (or ebnf-fonts-required
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4392 (setq ebnf-fonts-required
31255
81113bfa57a5 Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30572
diff changeset
4393 (mapconcat 'identity
81113bfa57a5 Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30572
diff changeset
4394 (ps-remove-duplicates
81113bfa57a5 Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30572
diff changeset
4395 (mapcar 'ebnf-font-name-select
81113bfa57a5 Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30572
diff changeset
4396 (list ebnf-production-font
81113bfa57a5 Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30572
diff changeset
4397 ebnf-terminal-font
81113bfa57a5 Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30572
diff changeset
4398 ebnf-non-terminal-font
81113bfa57a5 Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30572
diff changeset
4399 ebnf-special-font
81113bfa57a5 Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30572
diff changeset
4400 ebnf-except-font
81113bfa57a5 Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30572
diff changeset
4401 ebnf-repeat-font)))
81113bfa57a5 Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30572
diff changeset
4402 "\n%%+ font ")))
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4403 "\n%%Pages: 0\n%%EndComments\n\n%%BeginPrologue\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4404 ebnf-eps-prologue)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4405 (ebnf-insert-ebnf-prologue)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4406 (insert ebnf-eps-begin
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4407 "\n0 " (ebnf-format-float
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4408 (- ebnf-eps-upper-y (* ebnf-font-height-P 0.7)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4409 " #ebnf2ps#begin\n")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4410 ;; epilogue
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4411 (goto-char (point-max))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4412 (insert ebnf-eps-end)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4413 ;; write file
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4414 (message "Saving...")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4415 (setq filename (expand-file-name filename))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4416 (let ((coding-system-for-write 'raw-text-unix))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4417 (write-region (point-min) (point-max) filename))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4418 (message "Wrote %s" filename)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4419
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4420
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4421 (defun ebnf-insert-ebnf-prologue ()
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4422 (insert
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4423 (or ebnf-settings
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4424 (setq ebnf-settings
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4425 (concat
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4426 "\n\n% === begin EBNF settings\n\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4427 ;; production
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4428 (format "/fP %s /%s DefFont\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4429 (ebnf-format-float (ebnf-font-size ebnf-production-font))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4430 (ebnf-font-name-select ebnf-production-font))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4431 (ebnf-format-color "/ForegroundP %s def %% %s\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4432 (ebnf-font-foreground ebnf-production-font)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4433 "Black")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4434 (ebnf-format-color "/BackgroundP %s def %% %s\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4435 (ebnf-font-background ebnf-production-font)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4436 "White")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4437 (format "/EffectP %d def\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4438 (ebnf-font-attributes ebnf-production-font))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4439 ;; terminal
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4440 (format "/fT %s /%s DefFont\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4441 (ebnf-format-float (ebnf-font-size ebnf-terminal-font))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4442 (ebnf-font-name-select ebnf-terminal-font))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4443 (ebnf-format-color "/ForegroundT %s def %% %s\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4444 (ebnf-font-foreground ebnf-terminal-font)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4445 "Black")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4446 (ebnf-format-color "/BackgroundT %s def %% %s\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4447 (ebnf-font-background ebnf-terminal-font)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4448 "White")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4449 (format "/EffectT %d def\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4450 (ebnf-font-attributes ebnf-terminal-font))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4451 (format "/BorderWidthT %s def\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4452 (ebnf-format-float ebnf-terminal-border-width))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4453 (ebnf-format-color "/BorderColorT %s def %% %s\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4454 ebnf-terminal-border-color
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4455 "Black")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4456 (format "/ShapeT %d def\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4457 (ebnf-shape-value ebnf-terminal-shape
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4458 ebnf-terminal-shape-alist))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4459 (format "/ShadowT %s def\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4460 (ebnf-boolean ebnf-terminal-shadow))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4461 ;; non-terminal
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4462 (format "/fNT %s /%s DefFont\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4463 (ebnf-format-float
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4464 (ebnf-font-size ebnf-non-terminal-font))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4465 (ebnf-font-name-select ebnf-non-terminal-font))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4466 (ebnf-format-color "/ForegroundNT %s def %% %s\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4467 (ebnf-font-foreground ebnf-non-terminal-font)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4468 "Black")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4469 (ebnf-format-color "/BackgroundNT %s def %% %s\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4470 (ebnf-font-background ebnf-non-terminal-font)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4471 "White")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4472 (format "/EffectNT %d def\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4473 (ebnf-font-attributes ebnf-non-terminal-font))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4474 (format "/BorderWidthNT %s def\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4475 (ebnf-format-float ebnf-non-terminal-border-width))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4476 (ebnf-format-color "/BorderColorNT %s def %% %s\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4477 ebnf-non-terminal-border-color
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4478 "Black")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4479 (format "/ShapeNT %d def\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4480 (ebnf-shape-value ebnf-non-terminal-shape
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4481 ebnf-terminal-shape-alist))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4482 (format "/ShadowNT %s def\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4483 (ebnf-boolean ebnf-non-terminal-shadow))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4484 ;; special
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4485 (format "/fS %s /%s DefFont\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4486 (ebnf-format-float (ebnf-font-size ebnf-special-font))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4487 (ebnf-font-name-select ebnf-special-font))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4488 (ebnf-format-color "/ForegroundS %s def %% %s\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4489 (ebnf-font-foreground ebnf-special-font)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4490 "Black")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4491 (ebnf-format-color "/BackgroundS %s def %% %s\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4492 (ebnf-font-background ebnf-special-font)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4493 "Gray95")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4494 (format "/EffectS %d def\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4495 (ebnf-font-attributes ebnf-special-font))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4496 (format "/BorderWidthS %s def\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4497 (ebnf-format-float ebnf-special-border-width))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4498 (ebnf-format-color "/BorderColorS %s def %% %s\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4499 ebnf-special-border-color
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4500 "Black")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4501 (format "/ShapeS %d def\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4502 (ebnf-shape-value ebnf-special-shape
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4503 ebnf-terminal-shape-alist))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4504 (format "/ShadowS %s def\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4505 (ebnf-boolean ebnf-special-shadow))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4506 ;; except
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4507 (format "/fE %s /%s DefFont\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4508 (ebnf-format-float (ebnf-font-size ebnf-except-font))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4509 (ebnf-font-name-select ebnf-except-font))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4510 (ebnf-format-color "/ForegroundE %s def %% %s\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4511 (ebnf-font-foreground ebnf-except-font)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4512 "Black")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4513 (ebnf-format-color "/BackgroundE %s def %% %s\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4514 (ebnf-font-background ebnf-except-font)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4515 "Gray90")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4516 (format "/EffectE %d def\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4517 (ebnf-font-attributes ebnf-except-font))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4518 (format "/BorderWidthE %s def\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4519 (ebnf-format-float ebnf-except-border-width))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4520 (ebnf-format-color "/BorderColorE %s def %% %s\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4521 ebnf-except-border-color
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4522 "Black")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4523 (format "/ShapeE %d def\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4524 (ebnf-shape-value ebnf-except-shape
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4525 ebnf-terminal-shape-alist))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4526 (format "/ShadowE %s def\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4527 (ebnf-boolean ebnf-except-shadow))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4528 ;; repeat
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4529 (format "/fR %s /%s DefFont\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4530 (ebnf-format-float (ebnf-font-size ebnf-repeat-font))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4531 (ebnf-font-name-select ebnf-repeat-font))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4532 (ebnf-format-color "/ForegroundR %s def %% %s\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4533 (ebnf-font-foreground ebnf-repeat-font)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4534 "Black")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4535 (ebnf-format-color "/BackgroundR %s def %% %s\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4536 (ebnf-font-background ebnf-repeat-font)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4537 "Gray85")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4538 (format "/EffectR %d def\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4539 (ebnf-font-attributes ebnf-repeat-font))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4540 (format "/BorderWidthR %s def\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4541 (ebnf-format-float ebnf-repeat-border-width))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4542 (ebnf-format-color "/BorderColorR %s def %% %s\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4543 ebnf-repeat-border-color
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4544 "Black")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4545 (format "/ShapeR %d def\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4546 (ebnf-shape-value ebnf-repeat-shape
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4547 ebnf-terminal-shape-alist))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4548 (format "/ShadowR %s def\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4549 (ebnf-boolean ebnf-repeat-shadow))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4550 ;; miscellaneous
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4551 (format "/DefaultWidth %s def\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4552 (ebnf-format-float ebnf-default-width))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4553 (format "/LineWidth %s def\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4554 (ebnf-format-float ebnf-line-width))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4555 (ebnf-format-color "/LineColor %s def %% %s\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4556 ebnf-line-color
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4557 "Black")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4558 (format "/ArrowShape %d def\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4559 (ebnf-shape-value ebnf-arrow-shape
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4560 ebnf-arrow-shape-alist))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4561 (format "/ChartShape %d def\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4562 (ebnf-shape-value ebnf-chart-shape
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4563 ebnf-terminal-shape-alist))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4564 (format "/UserArrow{%s}def\n"
31255
81113bfa57a5 Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30572
diff changeset
4565 (let ((arrow (eval ebnf-user-arrow)))
81113bfa57a5 Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30572
diff changeset
4566 (if (stringp arrow)
81113bfa57a5 Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30572
diff changeset
4567 arrow
81113bfa57a5 Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30572
diff changeset
4568 "")))
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4569 "\n% === end EBNF settings\n\n"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4570 (and ebnf-debug-ps ebnf-debug))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4571 ebnf-prologue))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4572
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4573
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4574 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4575 ;; Adjusting dimensions
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4576
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4577
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4578 (defun ebnf-dimensions (tree)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4579 (let ((ebnf-total (length tree))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4580 (ebnf-nprod 0))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4581 (mapcar 'ebnf-production-dimension tree))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4582 tree)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4583
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4584
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4585 ;; [empty width-fun dim-fun entry height width]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4586 ;;(defun ebnf-empty-dimension (empty)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4587 ;; )
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4588
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4589
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4590 ;; [production width-fun dim-fun entry height width name production action]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4591 (defun ebnf-production-dimension (production)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4592 (ebnf-message-info "Calculating dimensions")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4593 (ebnf-node-dimension-func (ebnf-node-production production))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4594 (let* ((prod (ebnf-node-production production))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4595 (height (+ ebnf-font-height-P
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4596 ebnf-basic-height
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4597 (ebnf-node-height prod))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4598 (ebnf-node-entry production height)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4599 (ebnf-node-height production height)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4600 (ebnf-node-width production (+ (ebnf-node-width prod)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4601 ebnf-horizontal-space))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4602
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4603
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4604 ;; [terminal width-fun dim-fun entry height width name]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4605 (defun ebnf-terminal-dimension (terminal)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4606 (ebnf-terminal-dimension1 terminal
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4607 ebnf-font-height-T
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4608 ebnf-font-width-T
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4609 ebnf-space-T))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4610
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4611
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4612 ;; [non-terminal width-fun dim-fun entry height width name]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4613 (defun ebnf-non-terminal-dimension (non-terminal)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4614 (ebnf-terminal-dimension1 non-terminal
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4615 ebnf-font-height-NT
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4616 ebnf-font-width-NT
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4617 ebnf-space-NT))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4618
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4619
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4620 ;; [special width-fun dim-fun entry height width name]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4621 (defun ebnf-special-dimension (special)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4622 (ebnf-terminal-dimension1 special
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4623 ebnf-font-height-S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4624 ebnf-font-width-S
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4625 ebnf-space-S))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4626
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4627
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4628 (defun ebnf-terminal-dimension1 (node font-height font-width space)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4629 (let ((height (+ space font-height space))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4630 (len (length (ebnf-node-name node))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4631 (ebnf-node-entry node (* height 0.5))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4632 (ebnf-node-height node height)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4633 (ebnf-node-width node (+ ebnf-basic-width space
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4634 (* len font-width)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4635 space ebnf-basic-width))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4636
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4637
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4638 (defconst ebnf-null-vector (vector t t t 0.0 0.0 0.0))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4639
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4640
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4641 ;; [repeat width-fun dim-fun entry height width times element]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4642 (defun ebnf-repeat-dimension (repeat)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4643 (let ((times (ebnf-node-name repeat))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4644 (element (ebnf-node-separator repeat)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4645 (if element
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4646 (ebnf-node-dimension-func element)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4647 (setq element ebnf-null-vector))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4648 (ebnf-node-entry repeat (+ (ebnf-node-entry element)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4649 ebnf-space-R))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4650 (ebnf-node-height repeat (+ (max (ebnf-node-height element)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4651 ebnf-font-height-S)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4652 ebnf-space-R ebnf-space-R))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4653 (ebnf-node-width repeat (+ (ebnf-node-width element)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4654 ebnf-space-R ebnf-space-R ebnf-space-R
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4655 ebnf-horizontal-space
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4656 (* (length times) ebnf-font-width-R)))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4657
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4658
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4659 ;; [except width-fun dim-fun entry height width element element]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4660 (defun ebnf-except-dimension (except)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4661 (let ((factor (ebnf-node-list except))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4662 (element (ebnf-node-separator except)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4663 (ebnf-node-dimension-func factor)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4664 (if element
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4665 (ebnf-node-dimension-func element)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4666 (setq element ebnf-null-vector))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4667 (ebnf-node-entry except (+ (max (ebnf-node-entry factor)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4668 (ebnf-node-entry element))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4669 ebnf-space-E))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4670 (ebnf-node-height except (+ (max (ebnf-node-height factor)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4671 (ebnf-node-height element))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4672 ebnf-space-E ebnf-space-E))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4673 (ebnf-node-width except (+ (ebnf-node-width factor)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4674 (ebnf-node-width element)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4675 ebnf-space-E ebnf-space-E
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4676 ebnf-space-E ebnf-space-E
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4677 ebnf-font-width-E
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4678 ebnf-horizontal-space))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4679
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4680
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4681 ;; [alternative width-fun dim-fun entry height width list]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4682 (defun ebnf-alternative-dimension (alternative)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4683 (let ((body (ebnf-node-list alternative))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4684 (lis (ebnf-node-list alternative)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4685 (while lis
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4686 (ebnf-node-dimension-func (car lis))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4687 (setq lis (cdr lis)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4688 (let ((height 0.0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4689 (width 0.0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4690 (alt body)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4691 (tail (car (last body)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4692 (entry (ebnf-node-entry (car body)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4693 node)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4694 (while alt
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4695 (setq node (car alt)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4696 alt (cdr alt)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4697 height (+ (ebnf-node-height node) height)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4698 width (max (ebnf-node-width node) width)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4699 (ebnf-adjust-width body width)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4700 (setq height (+ height (* (1- (length body)) ebnf-vertical-space)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4701 (ebnf-node-entry alternative (+ entry
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4702 (ebnf-entry
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4703 (- height entry
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4704 (- (ebnf-node-height tail)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4705 (ebnf-node-entry tail))))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4706 (ebnf-node-height alternative height)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4707 (ebnf-node-width alternative (+ width ebnf-horizontal-space))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4708 (ebnf-node-list alternative body))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4709
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4710
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4711 ;; [optional width-fun dim-fun entry height width element]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4712 (defun ebnf-optional-dimension (optional)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4713 (let ((body (ebnf-node-list optional)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4714 (ebnf-node-dimension-func body)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4715 (ebnf-node-entry optional (ebnf-node-entry body))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4716 (ebnf-node-height optional (+ (ebnf-node-height body)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4717 ebnf-vertical-space))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4718 (ebnf-node-width optional (+ (ebnf-node-width body)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4719 ebnf-horizontal-space))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4720
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4721
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4722 ;; [one-or-more width-fun dim-fun entry height width element separator]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4723 (defun ebnf-one-or-more-dimension (or-more)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4724 (let ((list-part (ebnf-node-list or-more))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4725 (sep-part (ebnf-node-separator or-more)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4726 (ebnf-node-dimension-func list-part)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4727 (and sep-part
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4728 (ebnf-node-dimension-func sep-part))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4729 (let ((height (+ (if sep-part
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4730 (ebnf-node-height sep-part)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4731 0.0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4732 ebnf-vertical-space
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4733 (ebnf-node-height list-part)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4734 (width (max (if sep-part
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4735 (ebnf-node-width sep-part)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4736 0.0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4737 (ebnf-node-width list-part))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4738 (when sep-part
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4739 (ebnf-adjust-width list-part width)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4740 (ebnf-adjust-width sep-part width))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4741 (ebnf-node-entry or-more (+ (- height (ebnf-node-height list-part))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4742 (ebnf-node-entry list-part)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4743 (ebnf-node-height or-more height)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4744 (ebnf-node-width or-more (+ width ebnf-horizontal-space)))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4745
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4746
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4747 ;; [zero-or-more width-fun dim-fun entry height width element separator]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4748 (defun ebnf-zero-or-more-dimension (or-more)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4749 (let ((list-part (ebnf-node-list or-more))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4750 (sep-part (ebnf-node-separator or-more)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4751 (ebnf-node-dimension-func list-part)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4752 (and sep-part
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4753 (ebnf-node-dimension-func sep-part))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4754 (let ((height (+ (if sep-part
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4755 (ebnf-node-height sep-part)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4756 0.0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4757 ebnf-vertical-space
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4758 (ebnf-node-height list-part)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4759 ebnf-vertical-space))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4760 (width (max (if sep-part
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4761 (ebnf-node-width sep-part)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4762 0.0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4763 (ebnf-node-width list-part))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4764 (when sep-part
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4765 (ebnf-adjust-width list-part width)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4766 (ebnf-adjust-width sep-part width))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4767 (ebnf-node-entry or-more height)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4768 (ebnf-node-height or-more height)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4769 (ebnf-node-width or-more (+ width ebnf-horizontal-space)))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4770
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4771
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4772 ;; [sequence width-fun dim-fun entry height width list]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4773 (defun ebnf-sequence-dimension (sequence)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4774 (let ((above 0.0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4775 (below 0.0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4776 (width 0.0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4777 (lis (ebnf-node-list sequence))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4778 entry node)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4779 (while lis
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4780 (setq node (car lis)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4781 lis (cdr lis))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4782 (ebnf-node-dimension-func node)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4783 (setq entry (ebnf-node-entry node)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4784 above (max above entry)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4785 below (max below (- (ebnf-node-height node) entry))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4786 width (+ width (ebnf-node-width node))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4787 (ebnf-node-entry sequence above)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4788 (ebnf-node-height sequence (+ above below))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4789 (ebnf-node-width sequence width)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4790
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4791
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4792 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4793 ;; Adjusting width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4794
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4795
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4796 (defun ebnf-adjust-width (node width)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4797 (cond
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4798 ((listp node)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4799 (prog1
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4800 node
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4801 (while node
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4802 (setcar node (ebnf-adjust-width (car node) width))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4803 (setq node (cdr node)))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4804 ((vectorp node)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4805 (cond
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4806 ;; nothing to be done
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4807 ((= width (ebnf-node-width node))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4808 node)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4809 ;; left justify term
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4810 ((eq ebnf-justify-sequence 'left)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4811 (ebnf-adjust-empty node width nil))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4812 ;; right justify terms
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4813 ((eq ebnf-justify-sequence 'right)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4814 (ebnf-adjust-empty node width t))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4815 ;; centralize terms
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4816 (t
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4817 (ebnf-node-width-func node width)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4818 (ebnf-node-width node width)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4819 node)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4820 ))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4821 (t
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4822 node)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4823 ))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4824
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4825
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4826 (defun ebnf-adjust-empty (node width last-p)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4827 (if (eq (ebnf-node-kind node) 'ebnf-generate-empty)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4828 (progn
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4829 (ebnf-node-width node width)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4830 node)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4831 (let ((empty (ebnf-make-empty (- width (ebnf-node-width node)))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4832 (ebnf-make-dup-sequence node
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4833 (if last-p
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4834 (list empty node)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4835 (list node empty))))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4836
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4837
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4838 ;; [terminal width-fun dim-fun entry height width name]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4839 ;; [non-terminal width-fun dim-fun entry height width name]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4840 ;; [empty width-fun dim-fun entry height width]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4841 ;; [special width-fun dim-fun entry height width name]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4842 ;; [repeat width-fun dim-fun entry height width times element]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4843 ;; [except width-fun dim-fun entry height width element element]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4844 ;;(defun ebnf-terminal-width (terminal width)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4845 ;; )
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4846
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4847
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4848 ;; [alternative width-fun dim-fun entry height width list]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4849 ;; [optional width-fun dim-fun entry height width element]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4850 (defun ebnf-alternative-width (alternative width)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4851 (ebnf-adjust-width (ebnf-node-list alternative)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4852 (- width ebnf-horizontal-space)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4853
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4854
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4855 ;; [one-or-more width-fun dim-fun entry height width element separator]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4856 ;; [zero-or-more width-fun dim-fun entry height width element separator]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4857 (defun ebnf-list-width (or-more width)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4858 (setq width (- width ebnf-horizontal-space))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4859 (ebnf-node-list or-more
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4860 (ebnf-justify-list or-more
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4861 (ebnf-node-list or-more)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4862 width))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4863 (ebnf-node-separator or-more
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4864 (ebnf-justify-list or-more
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4865 (ebnf-node-separator or-more)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4866 width)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4867
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4868
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4869 ;; [sequence width-fun dim-fun entry height width list]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4870 (defun ebnf-sequence-width (sequence width)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4871 (ebnf-node-list sequence
30552
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
4872 (ebnf-justify-list sequence
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
4873 (ebnf-node-list sequence)
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
4874 width)))
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4875
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4876
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4877 (defun ebnf-justify-list (node seq width)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4878 (let ((seq-width (ebnf-node-width node)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4879 (if (= width seq-width)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4880 seq
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4881 (cond
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4882 ;; left justify terms
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4883 ((eq ebnf-justify-sequence 'left)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4884 (ebnf-justify node seq seq-width width t))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4885 ;; right justify terms
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4886 ((eq ebnf-justify-sequence 'right)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4887 (ebnf-justify node seq seq-width width nil))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4888 ;; centralize terms
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4889 (t
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4890 (let ((the-width (/ (- width seq-width) (length seq)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4891 (lis seq))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4892 (while lis
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4893 (ebnf-adjust-width (car lis)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4894 (+ (ebnf-node-width (car lis))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4895 the-width))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4896 (setq lis (cdr lis)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4897 seq))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4898 ))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4899
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4900
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4901 (defun ebnf-justify (node seq seq-width width last-p)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4902 (let ((term (car (if last-p (last seq) seq))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4903 (cond
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4904 ;; adjust empty term
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4905 ((eq (ebnf-node-kind term) 'ebnf-generate-empty)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4906 (ebnf-node-width term (+ (- width seq-width)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4907 (ebnf-node-width term)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4908 seq)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4909 ;; insert empty at end ==> left justify
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4910 (last-p
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4911 (nconc seq
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4912 (list (ebnf-make-empty (- width seq-width)))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4913 ;; insert empty at beginning ==> right justify
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4914 (t
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4915 (cons (ebnf-make-empty (- width seq-width))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4916 seq))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4917 )))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4918
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4919
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4920 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4921 ;; Functions used by parsers
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4922
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4923
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4924 (defun ebnf-eps-add-context (name)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4925 (let ((filename (ebnf-eps-filename name)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4926 (if (member filename ebnf-eps-context)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4927 (error "Try to open an already opened EPS file: %s" filename)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4928 (setq ebnf-eps-context (cons filename ebnf-eps-context)))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4929
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4930
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4931 (defun ebnf-eps-remove-context (name)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4932 (let ((filename (ebnf-eps-filename name)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4933 (if (member filename ebnf-eps-context)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4934 (setq ebnf-eps-context (delete filename ebnf-eps-context))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4935 (error "Try to close a not opened EPS file: %s" filename))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4936
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4937
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4938 (defun ebnf-eps-add-production (header)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4939 (and ebnf-eps-executing
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4940 ebnf-eps-context
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4941 (let ((prod (assoc header ebnf-eps-production-list)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4942 (if prod
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4943 (setcdr prod (append ebnf-eps-context (cdr prod)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4944 (setq ebnf-eps-production-list
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4945 (cons (cons header (ebnf-dup-list ebnf-eps-context))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4946 ebnf-eps-production-list))))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4947
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4948
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4949 (defun ebnf-dup-list (old)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4950 (let (new)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4951 (while old
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4952 (setq new (cons (car old) new)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4953 old (cdr old)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4954 (nreverse new)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4955
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4956
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4957 (defun ebnf-buffer-substring (chars)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4958 (buffer-substring-no-properties
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4959 (point)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4960 (progn
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4961 (skip-chars-forward chars ebnf-limit)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4962 (point))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4963
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4964
34803
de1f65fa5dcd Fix a problem with skip-chars-forward: it doesn't accept
Gerd Moellmann <gerd@gnu.org>
parents: 31255
diff changeset
4965 ;; replace the range "\240-\377" (see `ebnf-range-regexp').
de1f65fa5dcd Fix a problem with skip-chars-forward: it doesn't accept
Gerd Moellmann <gerd@gnu.org>
parents: 31255
diff changeset
4966 (defconst ebnf-8-bit-chars (ebnf-range-regexp "" ?\240 ?\377))
30572
f0463edb8518 Get around a bug on skip-chars-forward.
Gerd Moellmann <gerd@gnu.org>
parents: 30552
diff changeset
4967
f0463edb8518 Get around a bug on skip-chars-forward.
Gerd Moellmann <gerd@gnu.org>
parents: 30552
diff changeset
4968
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4969 (defun ebnf-string (chars eos-char kind)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4970 (forward-char)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4971 (buffer-substring-no-properties
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4972 (point)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4973 (progn
30572
f0463edb8518 Get around a bug on skip-chars-forward.
Gerd Moellmann <gerd@gnu.org>
parents: 30552
diff changeset
4974 ;;(skip-chars-forward (concat chars "\240-\377") ebnf-limit)
f0463edb8518 Get around a bug on skip-chars-forward.
Gerd Moellmann <gerd@gnu.org>
parents: 30552
diff changeset
4975 (skip-chars-forward (concat chars ebnf-8-bit-chars) ebnf-limit)
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4976 (if (or (eobp) (/= (following-char) eos-char))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4977 (error "Illegal %s: missing `%c'." kind eos-char)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4978 (forward-char)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4979 (1- (point))))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4980
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4981
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4982 (defun ebnf-get-string ()
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4983 (forward-char)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4984 (buffer-substring-no-properties (point) (ebnf-end-of-string)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4985
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4986
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4987 (defun ebnf-end-of-string ()
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4988 (let ((n 1))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4989 (while (> (logand n 1) 0)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4990 (skip-chars-forward "^\"" ebnf-limit)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4991 (setq n (- (skip-chars-backward "\\\\")))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4992 (goto-char (+ (point) n 1))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4993 (if (= (preceding-char) ?\")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4994 (1- (point))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4995 (error "Missing `\"'.")))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4996
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4997
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4998 (defun ebnf-trim-right (str)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4999 (let* ((len (1- (length str)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5000 (index len))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5001 (while (and (> index 0) (= (aref str index) ?\ ))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5002 (setq index (1- index)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5003 (if (= index len)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5004 str
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5005 (substring str 0 (1+ index)))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5006
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5007
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5008 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5009 ;; Vector creation
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5010
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5011
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5012 (defun ebnf-make-empty (&optional width)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5013 (vector 'ebnf-generate-empty
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5014 'ignore
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5015 'ignore
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5016 0.0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5017 0.0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5018 (or width ebnf-horizontal-space)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5019
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5020
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5021 (defun ebnf-make-terminal (name)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5022 (ebnf-make-terminal1 name
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5023 'ebnf-generate-terminal
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5024 'ebnf-terminal-dimension))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5025
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5026
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5027 (defun ebnf-make-non-terminal (name)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5028 (ebnf-make-terminal1 name
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5029 'ebnf-generate-non-terminal
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5030 'ebnf-non-terminal-dimension))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5031
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5032
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5033 (defun ebnf-make-special (name)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5034 (ebnf-make-terminal1 name
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5035 'ebnf-generate-special
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5036 'ebnf-special-dimension))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5037
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5038
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5039 (defun ebnf-make-terminal1 (name gen-func dim-func)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5040 (vector gen-func
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5041 'ignore
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5042 dim-func
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5043 0.0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5044 0.0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5045 0.0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5046 (let ((len (length name)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5047 (cond ((> len 2) name)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5048 ((= len 2) (concat " " name))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5049 ((= len 1) (concat " " name " "))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5050 (t " ")))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5051 ebnf-default-p))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5052
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5053
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5054 (defun ebnf-make-one-or-more (list-part &optional sep-part)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5055 (ebnf-make-or-more1 'ebnf-generate-one-or-more
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5056 'ebnf-one-or-more-dimension
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5057 list-part
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5058 sep-part))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5059
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5060
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5061 (defun ebnf-make-zero-or-more (list-part &optional sep-part)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5062 (ebnf-make-or-more1 'ebnf-generate-zero-or-more
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5063 'ebnf-zero-or-more-dimension
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5064 list-part
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5065 sep-part))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5066
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5067
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5068 (defun ebnf-make-or-more1 (gen-func dim-func list-part sep-part)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5069 (vector gen-func
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5070 'ebnf-list-width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5071 dim-func
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5072 0.0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5073 0.0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5074 0.0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5075 (if (listp list-part)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5076 (ebnf-make-sequence list-part)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5077 list-part)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5078 (if (and sep-part (listp sep-part))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5079 (ebnf-make-sequence sep-part)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5080 sep-part)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5081
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5082
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5083 (defun ebnf-make-production (name prod action)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5084 (vector 'ebnf-generate-production
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5085 'ignore
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5086 'ebnf-production-dimension
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5087 0.0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5088 0.0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5089 0.0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5090 name
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5091 prod
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5092 action))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5093
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5094
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5095 (defun ebnf-make-alternative (body)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5096 (vector 'ebnf-generate-alternative
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5097 'ebnf-alternative-width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5098 'ebnf-alternative-dimension
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5099 0.0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5100 0.0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5101 0.0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5102 body))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5103
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5104
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5105 (defun ebnf-make-optional (body)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5106 (vector 'ebnf-generate-optional
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5107 'ebnf-alternative-width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5108 'ebnf-optional-dimension
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5109 0.0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5110 0.0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5111 0.0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5112 body))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5113
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5114
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5115 (defun ebnf-make-except (factor exception)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5116 (vector 'ebnf-generate-except
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5117 'ignore
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5118 'ebnf-except-dimension
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5119 0.0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5120 0.0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5121 0.0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5122 factor
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5123 exception))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5124
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5125
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5126 (defun ebnf-make-repeat (times primary)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5127 (vector 'ebnf-generate-repeat
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5128 'ignore
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5129 'ebnf-repeat-dimension
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5130 0.0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5131 0.0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5132 0.0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5133 (concat times " *")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5134 primary))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5135
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5136
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5137 (defun ebnf-make-sequence (seq)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5138 (vector 'ebnf-generate-sequence
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5139 'ebnf-sequence-width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5140 'ebnf-sequence-dimension
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5141 0.0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5142 0.0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5143 0.0
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5144 seq))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5145
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5146
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5147 (defun ebnf-make-dup-sequence (node seq)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5148 (vector 'ebnf-generate-sequence
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5149 'ebnf-sequence-width
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5150 'ebnf-sequence-dimension
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5151 (ebnf-node-entry node)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5152 (ebnf-node-height node)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5153 (ebnf-node-width node)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5154 seq))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5155
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5156
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5157 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5158 ;; Optimizers used by parsers
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5159
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5160
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5161 (defun ebnf-token-except (element exception)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5162 (cons (prog1
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5163 (car exception)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5164 (setq exception (cdr exception)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5165 (and element ; EMPTY - A ==> EMPTY
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5166 (let ((kind (ebnf-node-kind element)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5167 (cond
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5168 ;; [ A ]- ==> A
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5169 ((and (null exception)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5170 (eq kind 'ebnf-generate-optional))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5171 (ebnf-node-list element))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5172 ;; { A }- ==> { A }+
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5173 ((and (null exception)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5174 (eq kind 'ebnf-generate-zero-or-more))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5175 (ebnf-node-kind element 'ebnf-generate-one-or-more)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5176 (ebnf-node-dimension-func element 'ebnf-one-or-more-dimension)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5177 element)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5178 ;; ( A | EMPTY )- ==> A
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5179 ;; ( A | B | EMPTY )- ==> A | B
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5180 ((and (null exception)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5181 (eq kind 'ebnf-generate-alternative)
30552
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
5182 (eq (ebnf-node-kind
a7498193b035 Update ps-print functions call. Indentation fix. Doc
Gerd Moellmann <gerd@gnu.org>
parents: 27539
diff changeset
5183 (car (last (ebnf-node-list element))))
27451
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5184 'ebnf-generate-empty))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5185 (let ((elt (ebnf-node-list element))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5186 bef)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5187 (while (cdr elt)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5188 (setq bef elt
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5189 elt (cdr elt)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5190 (if (null bef)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5191 ;; this should not happen!!?!
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5192 (setq element (ebnf-make-empty
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5193 (ebnf-node-width element)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5194 (setcdr bef nil)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5195 (setq elt (ebnf-node-list element))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5196 (and (= (length elt) 1)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5197 (setq element (car elt))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5198 element))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5199 ;; A - B
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5200 (t
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5201 (ebnf-make-except element exception))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5202 )))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5203
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5204
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5205 (defun ebnf-token-repeat (times repeat)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5206 (if (null (cdr repeat))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5207 ;; n * EMPTY ==> EMPTY
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5208 repeat
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5209 ;; n * term
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5210 (cons (car repeat)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5211 (ebnf-make-repeat times (cdr repeat)))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5212
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5213
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5214 (defun ebnf-token-optional (body)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5215 (let ((kind (ebnf-node-kind body)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5216 (cond
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5217 ;; [ EMPTY ] ==> EMPTY
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5218 ((eq kind 'ebnf-generate-empty)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5219 nil)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5220 ;; [ { A }* ] ==> { A }*
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5221 ((eq kind 'ebnf-generate-zero-or-more)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5222 body)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5223 ;; [ { A }+ ] ==> { A }*
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5224 ((eq kind 'ebnf-generate-one-or-more)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5225 (ebnf-node-kind body 'ebnf-generate-zero-or-more)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5226 body)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5227 ;; [ A | B ] ==> A | B | EMPTY
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5228 ((eq kind 'ebnf-generate-alternative)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5229 (ebnf-node-list body (nconc (ebnf-node-list body)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5230 (list (ebnf-make-empty))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5231 body)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5232 ;; [ A ]
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5233 (t
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5234 (ebnf-make-optional body))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5235 )))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5236
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5237
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5238 (defun ebnf-token-alternative (body sequence)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5239 (if (null body)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5240 (if (cdr sequence)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5241 sequence
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5242 (cons (car sequence)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5243 (ebnf-make-empty)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5244 (cons (car sequence)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5245 (let ((seq (cdr sequence)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5246 (if (and (= (length body) 1) (null seq))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5247 (car body)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5248 (ebnf-make-alternative (nreverse (if seq
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5249 (cons seq body)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5250 body))))))))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5251
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5252
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5253 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5254 ;; Variables used by parsers
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5255
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5256
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5257 (defconst ebnf-comment-table
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5258 (let ((table (make-vector 256 nil)))
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5259 ;; Override special comment character:
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5260 (aset table ?< 'newline)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5261 (aset table ?> 'keep-line)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5262 table)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5263 "Vector used to map characters to a special comment token.")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5264
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5265
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5266 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5267 ;; To make this file smaller, some commands go in a separate file.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5268 ;; But autoload them here to make the separation invisible.
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5269
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5270 (autoload 'ebnf-bnf-parser "ebnf-bnf"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5271 "EBNF parser.")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5272
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5273 (autoload 'ebnf-bnf-initialize "ebnf-bnf"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5274 "Initialize EBNF token table.")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5275
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5276 (autoload 'ebnf-iso-parser "ebnf-iso"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5277 "ISO EBNF parser.")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5278
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5279 (autoload 'ebnf-iso-initialize "ebnf-iso"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5280 "Initialize ISO EBNF token table.")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5281
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5282 (autoload 'ebnf-yac-parser "ebnf-yac"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5283 "Yacc/Bison parser.")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5284
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5285 (autoload 'ebnf-yac-initialize "ebnf-yac"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5286 "Initializations for Yacc/Bison parser.")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5287
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5288 (autoload 'ebnf-eliminate-empty-rules "ebnf-otz"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5289 "Eliminate empty rules.")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5290
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5291 (autoload 'ebnf-optimize "ebnf-otz"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5292 "Syntatic chart optimizer.")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5293
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5294 (autoload 'ebnf-otz-initialize "ebnf-otz"
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5295 "Initialize optimizer.")
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5296
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5297
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5298 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5299
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5300
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5301 (provide 'ebnf2ps)
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5302
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5303
f062cc830f07 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5304 ;;; ebnf2ps.el ends here