Mercurial > emacs
comparison lisp/progmodes/ebnf2ps.el @ 39342:73061d0eb82e
Replace "Prologue" by "Prolog" in PostScript
programming. Doc fix.
(ebnf-version): New version (3.6).
(ebnf-eps-begin): Data fix.
(ebnf-begin-file): Code fix.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Wed, 19 Sep 2001 08:54:10 +0000 |
parents | b174db545cfd |
children | ee17ab90f511 |
comparison
equal
deleted
inserted
replaced
39341:3c7fb43900bd | 39342:73061d0eb82e |
---|---|
1 ;;; ebnf2ps.el --- translate an EBNF to a syntatic chart on PostScript | 1 ;;; ebnf2ps.el --- translate an EBNF to a syntatic chart on PostScript |
2 | 2 |
3 ;; Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. | 3 ;; Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. |
4 | 4 |
5 ;; Author: Vinicius Jose Latorre <vinicius@cpqd.com.br> | 5 ;; Author: Vinicius Jose Latorre <vinicius@cpqd.com.br> |
6 ;; Maintainer: Vinicius Jose Latorre <vinicius@cpqd.com.br> | 6 ;; Maintainer: Vinicius Jose Latorre <vinicius@cpqd.com.br> |
7 ;; Keywords: wp, ebnf, PostScript | 7 ;; Keywords: wp, ebnf, PostScript |
8 ;; Time-stamp: <2001-07-15 01:05:00 pavel> | 8 ;; Time-stamp: <2001/09/18 21:29:37 vinicius> |
9 ;; Version: 3.5 | 9 ;; Version: 3.6 |
10 ;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/Emacs.html | 10 ;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/ |
11 | 11 |
12 ;; This file is part of GNU Emacs. | 12 ;; This file is part of GNU Emacs. |
13 | 13 |
14 ;; GNU Emacs is free software; you can redistribute it and/or modify | 14 ;; GNU Emacs is free software; you can redistribute it and/or modify |
15 ;; it under the terms of the GNU General Public License as published by | 15 ;; it under the terms of the GNU General Public License as published by |
24 ;; You should have received a copy of the GNU General Public License | 24 ;; You should have received a copy of the GNU General Public License |
25 ;; along with GNU Emacs; see the file COPYING. If not, write to the | 25 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
26 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 26 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
27 ;; Boston, MA 02111-1307, USA. | 27 ;; Boston, MA 02111-1307, USA. |
28 | 28 |
29 (defconst ebnf-version "3.5" | 29 (defconst ebnf-version "3.6" |
30 "ebnf2ps.el, v 3.5 <2001/02/02 vinicius> | 30 "ebnf2ps.el, v 3.6 <2001/09/18 vinicius> |
31 | 31 |
32 | 32 |
33 Vinicius's last change version. When reporting bugs, please also | 33 Vinicius's last change version. When reporting bugs, please also |
34 report the version of Emacs, if any, that ebnf2ps was running with. | 34 report the version of Emacs, if any, that ebnf2ps was running with. |
35 | 35 |
221 ;; | "{" body [ "||" body ] "}+" ;; one-or-more | 221 ;; | "{" body [ "||" body ] "}+" ;; one-or-more |
222 ;; | "{" body [ "||" body ] "}*" ;; zero-or-more | 222 ;; | "{" body [ "||" body ] "}*" ;; zero-or-more |
223 ;; | "{" body [ "||" body ] "}" ;; zero-or-more | 223 ;; | "{" body [ "||" body ] "}" ;; zero-or-more |
224 ;; . | 224 ;; . |
225 ;; | 225 ;; |
226 ;; non_terminal = "[A-Za-z\\240-\\377][!#%&'*-,0-:<>@-Z\\^-z~\\240-\\377]*". | 226 ;; non_terminal = "[!#%&'*-,0-:<>@-Z\\\\^-z~\\240-\\377]+". |
227 ;; | 227 ;; |
228 ;; terminal = "\\([^\"\\]\\|\\\\[ -~\\240-\\377]\\)+". | 228 ;; terminal = "\\([^\"\\]\\|\\\\[ -~\\240-\\377]\\)+". |
229 ;; | 229 ;; |
230 ;; special = "[^?\\n\\000-\\010\\016-\\037\\177-\\237]*". | 230 ;; special = "[^?\\n\\000-\\010\\016-\\037\\177-\\237]*". |
231 ;; | 231 ;; |
3553 {#ebnf2ps#dict begin /#ebnf2ps#save save def | 3553 {#ebnf2ps#dict begin /#ebnf2ps#save save def |
3554 moveto false BG 0.0 0.0 0.0 setrgbcolor}def | 3554 moveto false BG 0.0 0.0 0.0 setrgbcolor}def |
3555 | 3555 |
3556 /#ebnf2ps#end{showpage #ebnf2ps#save restore end}def | 3556 /#ebnf2ps#end{showpage #ebnf2ps#save restore end}def |
3557 | 3557 |
3558 %%EndPrologue | 3558 %%EndProlog |
3559 " | 3559 " |
3560 "EBNF EPS begin") | 3560 "EBNF EPS begin") |
3561 | 3561 |
3562 | 3562 |
3563 (defconst ebnf-eps-end | 3563 (defconst ebnf-eps-end |
4362 (end-of-line) | 4362 (end-of-line) |
4363 (backward-char) | 4363 (backward-char) |
4364 (insert " & ebnf2ps v" ebnf-version) | 4364 (insert " & ebnf2ps v" ebnf-version) |
4365 ;; insert ebnf settings & engine | 4365 ;; insert ebnf settings & engine |
4366 (goto-char (point-max)) | 4366 (goto-char (point-max)) |
4367 (search-backward "\n%%EndPrologue\n") | 4367 (search-backward "\n%%EndProlog\n") |
4368 (ebnf-insert-ebnf-prologue) | 4368 (ebnf-insert-ebnf-prologue) |
4369 (ps-output "\n"))))) | 4369 (ps-output "\n"))))) |
4370 | 4370 |
4371 | 4371 |
4372 (defun ebnf-eps-finish-and-write (buffer filename) | 4372 (defun ebnf-eps-finish-and-write (buffer filename) |
4398 ebnf-non-terminal-font | 4398 ebnf-non-terminal-font |
4399 ebnf-special-font | 4399 ebnf-special-font |
4400 ebnf-except-font | 4400 ebnf-except-font |
4401 ebnf-repeat-font))) | 4401 ebnf-repeat-font))) |
4402 "\n%%+ font "))) | 4402 "\n%%+ font "))) |
4403 "\n%%Pages: 0\n%%EndComments\n\n%%BeginPrologue\n" | 4403 "\n%%Pages: 0\n%%EndComments\n\n%%BeginProlog\n" |
4404 ebnf-eps-prologue) | 4404 ebnf-eps-prologue) |
4405 (ebnf-insert-ebnf-prologue) | 4405 (ebnf-insert-ebnf-prologue) |
4406 (insert ebnf-eps-begin | 4406 (insert ebnf-eps-begin |
4407 "\n0 " (ebnf-format-float | 4407 "\n0 " (ebnf-format-float |
4408 (- ebnf-eps-upper-y (* ebnf-font-height-P 0.7))) | 4408 (- ebnf-eps-upper-y (* ebnf-font-height-P 0.7))) |