diff options
| author | Chong Yidong | 2011-07-31 20:11:37 -0400 |
|---|---|---|
| committer | Chong Yidong | 2011-07-31 20:11:37 -0400 |
| commit | f79fbbc795f85969a7fc84f1e46ec8162c04b91b (patch) | |
| tree | 06e17fa1988314027840200b21e2c579362842c8 | |
| parent | 93855df97b1f05c7edce377c8af9da444b3dcc66 (diff) | |
| download | emacs-f79fbbc795f85969a7fc84f1e46ec8162c04b91b.tar.gz emacs-f79fbbc795f85969a7fc84f1e46ec8162c04b91b.zip | |
Tweak grammar files to match up with variable names used in parser files.
| -rw-r--r-- | etc/grammars/README | 18 | ||||
| -rw-r--r-- | etc/grammars/bovine-grammar.el | 9 | ||||
| -rw-r--r-- | etc/grammars/c.by | 2 | ||||
| -rw-r--r-- | etc/grammars/java-tags.wy | 16 | ||||
| -rw-r--r-- | etc/grammars/js.wy (renamed from etc/grammars/javascript-jv.wy) | 16 | ||||
| -rw-r--r-- | etc/grammars/make.by | 2 | ||||
| -rw-r--r-- | etc/grammars/python.wy | 2 | ||||
| -rw-r--r-- | etc/grammars/scheme.by | 2 | ||||
| -rw-r--r-- | etc/grammars/wisent-grammar.el | 4 |
9 files changed, 38 insertions, 33 deletions
diff --git a/etc/grammars/README b/etc/grammars/README index 657f9c20ecb..c8328bbc885 100644 --- a/etc/grammars/README +++ b/etc/grammars/README | |||
| @@ -3,15 +3,17 @@ generate the parser data in the lisp/semantic/bovine/ and | |||
| 3 | lisp/semantic/wisent/ directories. You can run the parser generators | 3 | lisp/semantic/wisent/ directories. You can run the parser generators |
| 4 | with | 4 | with |
| 5 | 5 | ||
| 6 | emacs -batch --no-site-file \ | 6 | emacs -batch --no-site-file -l bovine-grammar.el -f semantic-mode \ |
| 7 | -l semantic/bovine -l semantic/wisent -l semantic/grammar \ | 7 | -f semantic-grammar-batch-build-packages *.by |
| 8 | -l semantic/lex -l bovine-grammar.el \ | ||
| 9 | -f semantic-mode -f semantic-grammar-batch-build-packages *.by | ||
| 10 | 8 | ||
| 11 | emacs -batch --no-site-file \ | 9 | emacs -batch --no-site-file -l wisent-grammar.el -f semantic-mode \ |
| 12 | -l semantic/bovine -l semantic/wisent -l semantic/grammar \ | 10 | -f semantic-grammar-batch-build-packages *.wy |
| 13 | -l semantic/lex -l wisent-grammar.el \ | 11 | |
| 14 | -f semantic-mode -f semantic-grammar-batch-build-packages *.wy | 12 | The output files were subsequently edited by hand to fix copyright |
| 13 | headers, variable names (to follow library name conventions), and | ||
| 14 | feature names. These changes do not alter the code logic, and can be | ||
| 15 | viewed by diffing to the files in lisp/semantic/bovine/ and | ||
| 16 | lisp/semantic/wisent/. | ||
| 15 | 17 | ||
| 16 | Currently, the parser files in lisp/ are not generated directly from | 18 | Currently, the parser files in lisp/ are not generated directly from |
| 17 | these grammar files when making Emacs. This state of affairs, and the | 19 | these grammar files when making Emacs. This state of affairs, and the |
diff --git a/etc/grammars/bovine-grammar.el b/etc/grammars/bovine-grammar.el index 99da6ea5599..5a948608671 100644 --- a/etc/grammars/bovine-grammar.el +++ b/etc/grammars/bovine-grammar.el | |||
| @@ -32,6 +32,9 @@ | |||
| 32 | (require 'semantic) | 32 | (require 'semantic) |
| 33 | (require 'semantic/grammar) | 33 | (require 'semantic/grammar) |
| 34 | (require 'semantic/find) | 34 | (require 'semantic/find) |
| 35 | (require 'semantic/lex) | ||
| 36 | (require 'semantic/wisent) | ||
| 37 | (require 'semantic/bovine) | ||
| 35 | 38 | ||
| 36 | (defun bovine-grammar-EXPAND (bounds nonterm) | 39 | (defun bovine-grammar-EXPAND (bounds nonterm) |
| 37 | "Expand call to EXPAND grammar macro. | 40 | "Expand call to EXPAND grammar macro. |
| @@ -112,7 +115,6 @@ FORM is a list in which we are substituting. | |||
| 112 | Argument QUOTEMODE is non-nil if we are in backquote mode. | 115 | Argument QUOTEMODE is non-nil if we are in backquote mode. |
| 113 | When non-nil, optional argument INPLACE indicates that FORM is being | 116 | When non-nil, optional argument INPLACE indicates that FORM is being |
| 114 | expanded from elsewhere." | 117 | expanded from elsewhere." |
| 115 | (when (listp form) | ||
| 116 | (when (eq (car form) 'quote) | 118 | (when (eq (car form) 'quote) |
| 117 | (setq form (cdr form)) | 119 | (setq form (cdr form)) |
| 118 | (cond | 120 | (cond |
| @@ -218,7 +220,7 @@ expanded from elsewhere." | |||
| 218 | )) | 220 | )) |
| 219 | (if inlist (insert ")")) | 221 | (if inlist (insert ")")) |
| 220 | (if inplace (insert ")"))) | 222 | (if inplace (insert ")"))) |
| 221 | ))) | 223 | )) |
| 222 | 224 | ||
| 223 | (defun bovine-grammar-expand-action (textform quotemode) | 225 | (defun bovine-grammar-expand-action (textform quotemode) |
| 224 | "Expand semantic action string TEXTFORM into Lisp code. | 226 | "Expand semantic action string TEXTFORM into Lisp code. |
| @@ -226,7 +228,6 @@ QUOTEMODE is the mode in which quoted symbols are slurred." | |||
| 226 | (if (string= "" textform) | 228 | (if (string= "" textform) |
| 227 | nil | 229 | nil |
| 228 | (let ((sexp (read textform))) | 230 | (let ((sexp (read textform))) |
| 229 | |||
| 230 | ;; We converted the lambda string into a list. Now write it | 231 | ;; We converted the lambda string into a list. Now write it |
| 231 | ;; out as the bovine lambda expression, and do macro-like | 232 | ;; out as the bovine lambda expression, and do macro-like |
| 232 | ;; conversion upon it. | 233 | ;; conversion upon it. |
| @@ -339,7 +340,6 @@ manual." | |||
| 339 | (when (member nterm '("bovine-toplevel" "bovine-inner-scope")) | 340 | (when (member nterm '("bovine-toplevel" "bovine-inner-scope")) |
| 340 | (error "`%s' is a reserved internal name" nterm)) | 341 | (error "`%s' is a reserved internal name" nterm)) |
| 341 | (insert "\n(" nterm) | 342 | (insert "\n(" nterm) |
| 342 | |||
| 343 | ;; Process each rule | 343 | ;; Process each rule |
| 344 | (while rules | 344 | (while rules |
| 345 | (setq items (semantic-tag-get-attribute (car rules) :value) | 345 | (setq items (semantic-tag-get-attribute (car rules) :value) |
| @@ -375,7 +375,6 @@ manual." | |||
| 375 | (t | 375 | (t |
| 376 | (insert (semantic-grammar-item-text item))) | 376 | (insert (semantic-grammar-item-text item))) |
| 377 | )))) | 377 | )))) |
| 378 | |||
| 379 | (if prec | 378 | (if prec |
| 380 | (message "%%prec %S ignored" prec)) | 379 | (message "%%prec %S ignored" prec)) |
| 381 | (if actn | 380 | (if actn |
diff --git a/etc/grammars/c.by b/etc/grammars/c.by index cf8cb0c638e..1797827679b 100644 --- a/etc/grammars/c.by +++ b/etc/grammars/c.by | |||
| @@ -38,7 +38,7 @@ | |||
| 38 | ;; > * Can't parse signature element: "const RmcCmdMCDetailedStatus& status" | 38 | ;; > * Can't parse signature element: "const RmcCmdMCDetailedStatus& status" |
| 39 | ;; > * Can't parse signature element: "RmcBucStatus* rftBucStatus" | 39 | ;; > * Can't parse signature element: "RmcBucStatus* rftBucStatus" |
| 40 | 40 | ||
| 41 | %package c-by | 41 | %package semantic-c-by |
| 42 | 42 | ||
| 43 | %languagemode c-mode c++-mode | 43 | %languagemode c-mode c++-mode |
| 44 | %start declaration | 44 | %start declaration |
diff --git a/etc/grammars/java-tags.wy b/etc/grammars/java-tags.wy index aed39669c53..99d2b9df81d 100644 --- a/etc/grammars/java-tags.wy +++ b/etc/grammars/java-tags.wy | |||
| @@ -22,7 +22,7 @@ | |||
| 22 | ;; You should have received a copy of the GNU General Public License | 22 | ;; You should have received a copy of the GNU General Public License |
| 23 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | 23 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
| 24 | 24 | ||
| 25 | %package java-tags-wy | 25 | %package wisent-java-tags-wy |
| 26 | 26 | ||
| 27 | %languagemode java-mode | 27 | %languagemode java-mode |
| 28 | 28 | ||
| @@ -733,17 +733,17 @@ It ignores whitespaces, newlines and comments." | |||
| 733 | semantic-lex-ignore-newline | 733 | semantic-lex-ignore-newline |
| 734 | semantic-lex-ignore-comments | 734 | semantic-lex-ignore-comments |
| 735 | ;;;; Auto-generated analyzers. | 735 | ;;;; Auto-generated analyzers. |
| 736 | semantic/wisent/java-tags-wy--<number>-regexp-analyzer | 736 | wisent-java-tags-wy--<number>-regexp-analyzer |
| 737 | semantic/wisent/java-tags-wy--<string>-sexp-analyzer | 737 | wisent-java-tags-wy--<string>-sexp-analyzer |
| 738 | ;; Must detect keywords before other symbols | 738 | ;; Must detect keywords before other symbols |
| 739 | semantic/wisent/java-tags-wy--<keyword>-keyword-analyzer | 739 | wisent-java-tags-wy--<keyword>-keyword-analyzer |
| 740 | semantic/wisent/java-tags-wy--<symbol>-regexp-analyzer | 740 | wisent-java-tags-wy--<symbol>-regexp-analyzer |
| 741 | semantic/wisent/java-tags-wy--<punctuation>-string-analyzer | 741 | wisent-java-tags-wy--<punctuation>-string-analyzer |
| 742 | semantic/wisent/java-tags-wy--<block>-block-analyzer | 742 | wisent-java-tags-wy--<block>-block-analyzer |
| 743 | ;; In theory, unicode chars should be turned into normal chars | 743 | ;; In theory, unicode chars should be turned into normal chars |
| 744 | ;; and then combined into regular ascii keywords and text. This | 744 | ;; and then combined into regular ascii keywords and text. This |
| 745 | ;; analyzer just keeps these things from making the lexer go boom. | 745 | ;; analyzer just keeps these things from making the lexer go boom. |
| 746 | semantic/wisent/java-tags-wy--<unicode>-regexp-analyzer | 746 | wisent-java-tags-wy--<unicode>-regexp-analyzer |
| 747 | ;;;; | 747 | ;;;; |
| 748 | semantic-lex-default-action) | 748 | semantic-lex-default-action) |
| 749 | 749 | ||
diff --git a/etc/grammars/javascript-jv.wy b/etc/grammars/js.wy index ba518392ae2..a13abf56e6e 100644 --- a/etc/grammars/javascript-jv.wy +++ b/etc/grammars/js.wy | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | ;;; javascript-jv.wy -- LALR grammar for Javascript | 1 | ;;; javascript-jv.wy -- LALR grammar for Javascript |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2005-2011 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2005-2011 Free Software Foundation, Inc. |
| 4 | ;; Copyright (C) Ecma International. | 4 | ;; Copyright (C) 1998-2011 Ecma International. |
| 5 | 5 | ||
| 6 | ;; Author: Joakim Verona | 6 | ;; Author: Joakim Verona |
| 7 | 7 | ||
| @@ -57,7 +57,7 @@ | |||
| 57 | ;; USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH | 57 | ;; USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH |
| 58 | ;; DAMAGE. | 58 | ;; DAMAGE. |
| 59 | 59 | ||
| 60 | %package javascript-jv-wy | 60 | %package wisent-javascript-jv-wy |
| 61 | ;; JAVE I prefere ecmascript-mode | 61 | ;; JAVE I prefere ecmascript-mode |
| 62 | %languagemode ecmascript-mode javascript-mode | 62 | %languagemode ecmascript-mode javascript-mode |
| 63 | 63 | ||
| @@ -509,14 +509,14 @@ OptionalExpression : Expression | |||
| 509 | semantic-lex-ignore-comments | 509 | semantic-lex-ignore-comments |
| 510 | 510 | ||
| 511 | ;;stuff generated from the wy file(one for each "type" declaration) | 511 | ;;stuff generated from the wy file(one for each "type" declaration) |
| 512 | semantic/wisent/javascript-jv-wy--<number>-regexp-analyzer | 512 | wisent-javascript-jv-wy--<number>-regexp-analyzer |
| 513 | semantic/wisent/javascript-jv-wy--<string>-sexp-analyzer | 513 | wisent-javascript-jv-wy--<string>-sexp-analyzer |
| 514 | 514 | ||
| 515 | semantic/wisent/javascript-jv-wy--<keyword>-keyword-analyzer | 515 | wisent-javascript-jv-wy--<keyword>-keyword-analyzer |
| 516 | 516 | ||
| 517 | semantic/wisent/javascript-jv-wy--<symbol>-regexp-analyzer | 517 | wisent-javascript-jv-wy--<symbol>-regexp-analyzer |
| 518 | semantic/wisent/javascript-jv-wy--<punctuation>-string-analyzer | 518 | wisent-javascript-jv-wy--<punctuation>-string-analyzer |
| 519 | semantic/wisent/javascript-jv-wy--<block>-block-analyzer | 519 | wisent-javascript-jv-wy--<block>-block-analyzer |
| 520 | 520 | ||
| 521 | 521 | ||
| 522 | ;;;;more std stuff | 522 | ;;;;more std stuff |
diff --git a/etc/grammars/make.by b/etc/grammars/make.by index 3eb56bf2b49..dab4472b737 100644 --- a/etc/grammars/make.by +++ b/etc/grammars/make.by | |||
| @@ -21,7 +21,7 @@ | |||
| 21 | ;; You should have received a copy of the GNU General Public License | 21 | ;; You should have received a copy of the GNU General Public License |
| 22 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | 22 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
| 23 | 23 | ||
| 24 | %package make-by | 24 | %package semantic-make-by |
| 25 | 25 | ||
| 26 | %languagemode makefile-mode | 26 | %languagemode makefile-mode |
| 27 | %start Makefile | 27 | %start Makefile |
diff --git a/etc/grammars/python.wy b/etc/grammars/python.wy index 8a7b7771d53..a0af813e5e8 100644 --- a/etc/grammars/python.wy +++ b/etc/grammars/python.wy | |||
| @@ -86,7 +86,7 @@ | |||
| 86 | ;; Settings | 86 | ;; Settings |
| 87 | ;; -------- | 87 | ;; -------- |
| 88 | 88 | ||
| 89 | %package python-wy | 89 | %package wisent-python-wy |
| 90 | 90 | ||
| 91 | %languagemode python-mode | 91 | %languagemode python-mode |
| 92 | 92 | ||
diff --git a/etc/grammars/scheme.by b/etc/grammars/scheme.by index 9e57afe7438..bc6612d4c70 100644 --- a/etc/grammars/scheme.by +++ b/etc/grammars/scheme.by | |||
| @@ -17,7 +17,7 @@ | |||
| 17 | ;; You should have received a copy of the GNU General Public License | 17 | ;; You should have received a copy of the GNU General Public License |
| 18 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | 18 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
| 19 | 19 | ||
| 20 | %package scm-by | 20 | %package semantic-scm-by |
| 21 | 21 | ||
| 22 | %languagemode scheme-mode | 22 | %languagemode scheme-mode |
| 23 | %start scheme | 23 | %start scheme |
diff --git a/etc/grammars/wisent-grammar.el b/etc/grammars/wisent-grammar.el index 1bef2646645..d7de1ee6f7b 100644 --- a/etc/grammars/wisent-grammar.el +++ b/etc/grammars/wisent-grammar.el | |||
| @@ -26,8 +26,12 @@ | |||
| 26 | ;; Major mode for editing Wisent's input grammar (.wy) files. | 26 | ;; Major mode for editing Wisent's input grammar (.wy) files. |
| 27 | 27 | ||
| 28 | ;;; Code: | 28 | ;;; Code: |
| 29 | (require 'semantic) | ||
| 29 | (require 'semantic/grammar) | 30 | (require 'semantic/grammar) |
| 30 | (require 'semantic/find) | 31 | (require 'semantic/find) |
| 32 | (require 'semantic/lex) | ||
| 33 | (require 'semantic/wisent) | ||
| 34 | (require 'semantic/bovine) | ||
| 31 | 35 | ||
| 32 | (defsubst wisent-grammar-region-placeholder (symb) | 36 | (defsubst wisent-grammar-region-placeholder (symb) |
| 33 | "Given a $N placeholder symbol in SYMB, return a $regionN symbol. | 37 | "Given a $N placeholder symbol in SYMB, return a $regionN symbol. |