aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann1999-12-21 14:01:00 +0000
committerGerd Moellmann1999-12-21 14:01:00 +0000
commite33e080c0956f9bdb2fa9e31eba101e1997e7c62 (patch)
tree9294cb11a4b994fad68cdb9359b9b44d827db9ea
parent3476b54a0c4b081c406110a2efc710b2ac903120 (diff)
downloademacs-e33e080c0956f9bdb2fa9e31eba101e1997e7c62.tar.gz
emacs-e33e080c0956f9bdb2fa9e31eba101e1997e7c62.zip
Version 1.2 is released.
(antlr): This package has a web page. Menu/keymap additions for commenting/uncommenting regions. Suggested by Dale Davis <Dale_Davis@securify.com>. (antlr-mode-map): New binding [C-c C-c]. (antlr-mode-menu): New entries. Respect Emacs conventions. ((require 'cl)): Only use during compilation. (antlr-language-for-option): New function to avoid using `find'. (antlr-mode): Use it. (antlr-with-syntax-table): Define new instead using XEmacs' one. (antlr-imenu-create-index-function): Change accordingly. (antlr-inside-rule-p): Ditto. (antlr-end-of-rule): Ditto. (antlr-end-of-body): Ditto. (antlr-beginning-of-rule): Ditto. (antlr-indent-line): Ditto. Really use `antlr-tab-offset-alist'. (antlr-set-tabs): Don't use hard-coded values. Minor navigation changes. Not perfect, but this won't be possible without a huge time penalty. (antlr-skip-exception-part): Be more specific. (antlr-skip-file-prelude): Don't skip action prelude of next rule. Renamed from `antlr-skip-grammar-header'. (antlr-next-rule): Change accordingly. (antlr-end-of-body): Ditto. Better error message. (antlr-beginning-of-body): Better error message. (antlr-imenu-create-index-function): Skip rule action prelude. Minor syntax highlighting changes. (antlr-font-lock-default-face): Deletia. (antlr-font-lock-tokendef-face): Changed color. (antlr-font-lock-tokenref-face): Changed color. (antlr-font-lock-literal-face): Changed color. (antlr-font-lock-additional-keywords): Minor changes.
-rw-r--r--lisp/ChangeLog48
-rw-r--r--lisp/progmodes/antlr-mode.el38
2 files changed, 77 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 0ada0385064..c6edadde347 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,51 @@
11999-12-21 Christoph Wedler <Christoph.Wedler@sap.com>
2
3 * antlr-mode.el: Version 1.2 is released.
4 (antlr): This package has a web page.
5
61999-12-21 Christoph Wedler <Christoph.Wedler@sap.com>
7
8 * antlr-mode.el: Menu/keymap additions for commenting/uncommenting
9 regions. Suggested by Dale Davis <Dale_Davis@securify.com>.
10 (antlr-mode-map): New binding [C-c C-c].
11 (antlr-mode-menu): New entries.
12
131999-12-21 Christoph Wedler <Christoph.Wedler@sap.com>
14
15 * antlr-mode.el: Respect Emacs conventions.
16 ((require 'cl)): Only use during compilation.
17 (antlr-language-for-option): New function to avoid using `find'.
18 (antlr-mode): Use it.
19 (antlr-with-syntax-table): Define new instead using XEmacs' one.
20 (antlr-imenu-create-index-function): Change accordingly.
21 (antlr-inside-rule-p): Ditto.
22 (antlr-end-of-rule): Ditto.
23 (antlr-end-of-body): Ditto.
24 (antlr-beginning-of-rule): Ditto.
25 (antlr-indent-line): Ditto.
26
271999-11-21 Christoph Wedler <Christoph.Wedler@sap.com>
28
29 * antlr-mode.el: Really use `antlr-tab-offset-alist'.
30 (antlr-set-tabs): Don't use hard-coded values.
31
32 * antlr-mode.el: Minor navigation changes. Not perfect, but this
33 won't be possible without a huge time penalty.
34 (antlr-skip-exception-part): Be more specific.
35 (antlr-skip-file-prelude): Don't skip action prelude of next rule.
36 Renamed from `antlr-skip-grammar-header'.
37 (antlr-next-rule): Change accordingly.
38 (antlr-end-of-body): Ditto. Better error message.
39 (antlr-beginning-of-body): Better error message.
40 (antlr-imenu-create-index-function): Skip rule action prelude.
41
42 * antlr-mode.el: Minor syntax highlighting changes.
43 (antlr-font-lock-default-face): Deletia.
44 (antlr-font-lock-tokendef-face): Changed color.
45 (antlr-font-lock-tokenref-face): Changed color.
46 (antlr-font-lock-literal-face): Changed color.
47 (antlr-font-lock-additional-keywords): Minor changes.
48
11999-12-21 Gerd Moellmann <gerd@gnu.org> 491999-12-21 Gerd Moellmann <gerd@gnu.org>
2 50
3 * progmodes/cwarn.el: New file. 51 * progmodes/cwarn.el: New file.
diff --git a/lisp/progmodes/antlr-mode.el b/lisp/progmodes/antlr-mode.el
index 22aecd8279f..f25de9969af 100644
--- a/lisp/progmodes/antlr-mode.el
+++ b/lisp/progmodes/antlr-mode.el
@@ -3,7 +3,8 @@
3;; Copyright (C) 1999 Free Software Foundation, Inc. 3;; Copyright (C) 1999 Free Software Foundation, Inc.
4;; 4;;
5;; Author: Christoph.Wedler@sap.com 5;; Author: Christoph.Wedler@sap.com
6;; Version: $Id: antlr-mode.el,v 1.2 1999/11/11 14:40:51 wedler Exp $ 6;; Version: $Id: antlr-mode.el,v 1.2 1999/12/16 19:30:34 wedler Exp $
7;; X-URL: http://www.fmi.uni-passau.de/~wedler/antlr-mode/
7 8
8;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
9 10
@@ -35,7 +36,7 @@
35 36
36;; This package provides the following features: 37;; This package provides the following features:
37;; * Indentation for the current line (TAB) and selected region (C-M-\). 38;; * Indentation for the current line (TAB) and selected region (C-M-\).
38;; * Syntax coloring (via font-lock) with language dependend coloring. 39;; * Syntax coloring (via font-lock) with language dependent coloring.
39;; * Support for imenu/speedbar: menu "Index" (Parser, Lexer, TreeParser). 40;; * Support for imenu/speedbar: menu "Index" (Parser, Lexer, TreeParser).
40;; * Direct move to previous/next rule, beginning/end of rule body etc. 41;; * Direct move to previous/next rule, beginning/end of rule body etc.
41 42
@@ -57,6 +58,10 @@
57;; special font-lock faces for the grammar code to allow you to distinguish 58;; special font-lock faces for the grammar code to allow you to distinguish
58;; ANTLR keywords from Java/C++ keywords. 59;; ANTLR keywords from Java/C++ keywords.
59 60
61;; Bug fixes, bug reports, improvements, and suggestions are strongly
62;; appreciated. Please check the newest version first:
63;; http://www.fmi.uni-passau.de/~wedler/antlr-mode/changes.html
64
60;;; Installation: 65;;; Installation:
61 66
62;; This file requires Emacs-20.3, XEmacs-20.4 or higher. 67;; This file requires Emacs-20.3, XEmacs-20.4 or higher.
@@ -105,6 +110,7 @@
105 "Major mode for ANTLR grammar files." 110 "Major mode for ANTLR grammar files."
106 :group 'languages 111 :group 'languages
107 :link '(emacs-commentary-link "antlr-mode.el") 112 :link '(emacs-commentary-link "antlr-mode.el")
113 :link '(url-link "http://www.fmi.uni-passau.de/~wedler/antlr-mode/")
108 :prefix "antlr-") 114 :prefix "antlr-")
109 115
110(defconst antlr-version "1.2" 116(defconst antlr-version "1.2"
@@ -212,6 +218,7 @@ imenu."
212 (define-key map "\C-c\C-e" 'antlr-end-of-body) 218 (define-key map "\C-c\C-e" 'antlr-end-of-body)
213 (define-key map "\C-c\C-f" 'c-forward-into-nomenclature) 219 (define-key map "\C-c\C-f" 'c-forward-into-nomenclature)
214 (define-key map "\C-c\C-b" 'c-backward-into-nomenclature) 220 (define-key map "\C-c\C-b" 'c-backward-into-nomenclature)
221 (define-key map "\C-c\C-c" 'comment-region)
215 ;; I'm too lazy to define my own: 222 ;; I'm too lazy to define my own:
216 (define-key map "\ea" 'c-beginning-of-statement) 223 (define-key map "\ea" 'c-beginning-of-statement)
217 (define-key map "\ee" 'c-end-of-statement) 224 (define-key map "\ee" 'c-end-of-statement)
@@ -226,6 +233,14 @@ imenu."
226 :active (not buffer-read-only)] 233 :active (not buffer-read-only)]
227 ["Indent for Comment" indent-for-comment 234 ["Indent for Comment" indent-for-comment
228 :active (not buffer-read-only)] 235 :active (not buffer-read-only)]
236 ["Comment Out Region" comment-region
237 :active (and (not buffer-read-only)
238 (c-region-is-active-p))]
239 ["Uncomment Region"
240 (comment-region (region-beginning) (region-end) '(4))
241 :active (and (not buffer-read-only)
242 (c-region-is-active-p))]
243 "---"
229 ["Backward Rule" antlr-beginning-of-rule t] 244 ["Backward Rule" antlr-beginning-of-rule t]
230 ["Forward Rule" antlr-end-of-rule t] 245 ["Forward Rule" antlr-end-of-rule t]
231 ["Start of Rule Body" antlr-beginning-of-body 246 ["Start of Rule Body" antlr-beginning-of-body
@@ -427,7 +442,7 @@ context_cache.")
427;; checkdoc-params: (from count dummy) 442;; checkdoc-params: (from count dummy)
428 "Like `scan-sexps' but with additional arguments. 443 "Like `scan-sexps' but with additional arguments.
429When optional arg NO-ERROR is non-nil, `scan-sexps' will return nil 444When optional arg NO-ERROR is non-nil, `scan-sexps' will return nil
430instead of signalling an error." 445instead of signaling an error."
431 (if no-error 446 (if no-error
432 (condition-case nil 447 (condition-case nil
433 (scan-sexps from count) 448 (scan-sexps from count)
@@ -479,7 +494,7 @@ WARNING: this may alter `match-data'."
479(defun antlr-re-search-forward (regexp bound) 494(defun antlr-re-search-forward (regexp bound)
480 "Search forward from point for regular expression REGEXP. 495 "Search forward from point for regular expression REGEXP.
481Set point to the end of the occurrence found, and return point. Return 496Set point to the end of the occurrence found, and return point. Return
482nil if no occurence was found. Do not search within comments, strings 497nil if no occurrence was found. Do not search within comments, strings
483and actions/semantic predicates. BOUND bounds the search; it is a 498and actions/semantic predicates. BOUND bounds the search; it is a
484buffer position. See also the functions `match-beginning', `match-end' 499buffer position. See also the functions `match-beginning', `match-end'
485and `replace-match'." 500and `replace-match'."
@@ -493,7 +508,7 @@ and `replace-match'."
493(defun antlr-search-forward (string) 508(defun antlr-search-forward (string)
494 "Search forward from point for STRING. 509 "Search forward from point for STRING.
495Set point to the end of the occurrence found, and return point. Return 510Set point to the end of the occurrence found, and return point. Return
496nil if no occurence was found. Do not search within comments, strings 511nil if no occurrence was found. Do not search within comments, strings
497and actions/semantic predicates." 512and actions/semantic predicates."
498 ;; WARNING: Should only be used with `antlr-action-syntax-table'! 513 ;; WARNING: Should only be used with `antlr-action-syntax-table'!
499 (let ((continue t)) 514 (let ((continue t))
@@ -504,7 +519,7 @@ and actions/semantic predicates."
504(defun antlr-search-backward (string) 519(defun antlr-search-backward (string)
505 "Search backward from point for STRING. 520 "Search backward from point for STRING.
506Set point to the beginning of the occurrence found, and return point. 521Set point to the beginning of the occurrence found, and return point.
507Return nil if no occurence was found. Do not search within comments, 522Return nil if no occurrence was found. Do not search within comments,
508strings and actions/semantic predicates." 523strings and actions/semantic predicates."
509 ;; WARNING: Should only be used with `antlr-action-syntax-table'! 524 ;; WARNING: Should only be used with `antlr-action-syntax-table'!
510 (let ((continue t)) 525 (let ((continue t))
@@ -545,7 +560,7 @@ See `antlr-font-lock-additional-keywords', `antlr-language' and
545;;;=========================================================================== 560;;;===========================================================================
546 561
547(defun antlr-imenu-create-index-function () 562(defun antlr-imenu-create-index-function ()
548 "Return imenu index-alist for ANTLR gramar files." 563 "Return imenu index-alist for ANTLR grammar files."
549 (let ((items nil) 564 (let ((items nil)
550 (lexer nil) 565 (lexer nil)
551 (parser nil) 566 (parser nil)
@@ -646,7 +661,7 @@ If SKIP-COMMENT is non-nil, also skip the comment after that part."
646 "Move forward to next end of rule. Do it ARG many times. 661 "Move forward to next end of rule. Do it ARG many times.
647A grammar class header and the file prelude are also considered as a 662A grammar class header and the file prelude are also considered as a
648rule. Negative argument ARG means move back to ARGth preceding end of 663rule. Negative argument ARG means move back to ARGth preceding end of
649rule. The behaviour is not defined when ARG is zero. If SKIP-COMMENT 664rule. The behavior is not defined when ARG is zero. If SKIP-COMMENT
650is non-nil, move to beginning of the rule." 665is non-nil, move to beginning of the rule."
651 ;; WARNING: Should only be used with `antlr-action-syntax-table'! 666 ;; WARNING: Should only be used with `antlr-action-syntax-table'!
652 ;; PRE: ARG<>0 667 ;; PRE: ARG<>0
@@ -778,7 +793,7 @@ multiplied by:
778 - minus 1 if `antlr-indent-item-regexp' matches the beginning of the 793 - minus 1 if `antlr-indent-item-regexp' matches the beginning of the
779 line starting from the first non-blank. 794 line starting from the first non-blank.
780 795
781Lines inside block commments are not changed or indented by 796Lines inside block comments are not changed or indented by
782`c-indent-line', see `antlr-indent-comment'." 797`c-indent-line', see `antlr-indent-comment'."
783 (let ((orig (point)) bol boi indent syntax) 798 (let ((orig (point)) bol boi indent syntax)
784 (beginning-of-line) 799 (beginning-of-line)
@@ -992,3 +1007,8 @@ Used in `antlr-mode'. Also a useful function in `java-mode-hook'."
992 alist nil)))))) 1007 alist nil))))))
993 1008
994;;; antlr-mode.el ends here 1009;;; antlr-mode.el ends here
1010
1011; LocalWords: antlr ANother ANTLR's Cpp Lexer TreeParser esp refs VALUEs ea ee
1012; LocalWords: Java's Nomencl ruledef tokendef ruleref tokenref setType ader
1013; LocalWords: ivate syntab lexer treeparser lic rotected rivate bor boi AFAIK
1014; LocalWords: slist knr inexpr