summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2011-07-31 20:11:37 -0400
committerChong Yidong <cyd@stupidchicken.com>2011-07-31 20:11:37 -0400
commitf79fbbc795f85969a7fc84f1e46ec8162c04b91b (patch)
tree06e17fa1988314027840200b21e2c579362842c8 /etc
parent93855df97b1f05c7edce377c8af9da444b3dcc66 (diff)
Tweak grammar files to match up with variable names used in parser files.
Diffstat (limited to 'etc')
-rw-r--r--etc/grammars/README18
-rw-r--r--etc/grammars/bovine-grammar.el9
-rw-r--r--etc/grammars/c.by2
-rw-r--r--etc/grammars/java-tags.wy16
-rw-r--r--etc/grammars/js.wy (renamed from etc/grammars/javascript-jv.wy)16
-rw-r--r--etc/grammars/make.by2
-rw-r--r--etc/grammars/python.wy2
-rw-r--r--etc/grammars/scheme.by2
-rw-r--r--etc/grammars/wisent-grammar.el4
9 files changed, 38 insertions, 33 deletions
diff --git a/etc/grammars/README b/etc/grammars/README
index 657f9c20ec..c8328bbc88 100644
--- a/etc/grammars/README
+++ b/etc/grammars/README
@@ -3,15 +3,17 @@ generate the parser data in the lisp/semantic/bovine/ and
lisp/semantic/wisent/ directories. You can run the parser generators
with
-emacs -batch --no-site-file \
- -l semantic/bovine -l semantic/wisent -l semantic/grammar \
- -l semantic/lex -l bovine-grammar.el \
- -f semantic-mode -f semantic-grammar-batch-build-packages *.by
+emacs -batch --no-site-file -l bovine-grammar.el -f semantic-mode \
+ -f semantic-grammar-batch-build-packages *.by
-emacs -batch --no-site-file \
- -l semantic/bovine -l semantic/wisent -l semantic/grammar \
- -l semantic/lex -l wisent-grammar.el \
- -f semantic-mode -f semantic-grammar-batch-build-packages *.wy
+emacs -batch --no-site-file -l wisent-grammar.el -f semantic-mode \
+ -f semantic-grammar-batch-build-packages *.wy
+
+The output files were subsequently edited by hand to fix copyright
+headers, variable names (to follow library name conventions), and
+feature names. These changes do not alter the code logic, and can be
+viewed by diffing to the files in lisp/semantic/bovine/ and
+lisp/semantic/wisent/.
Currently, the parser files in lisp/ are not generated directly from
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 99da6ea559..5a94860867 100644
--- a/etc/grammars/bovine-grammar.el
+++ b/etc/grammars/bovine-grammar.el
@@ -32,6 +32,9 @@
(require 'semantic)
(require 'semantic/grammar)
(require 'semantic/find)
+(require 'semantic/lex)
+(require 'semantic/wisent)
+(require 'semantic/bovine)
(defun bovine-grammar-EXPAND (bounds nonterm)
"Expand call to EXPAND grammar macro.
@@ -112,7 +115,6 @@ FORM is a list in which we are substituting.
Argument QUOTEMODE is non-nil if we are in backquote mode.
When non-nil, optional argument INPLACE indicates that FORM is being
expanded from elsewhere."
- (when (listp form)
(when (eq (car form) 'quote)
(setq form (cdr form))
(cond
@@ -218,7 +220,7 @@ expanded from elsewhere."
))
(if inlist (insert ")"))
(if inplace (insert ")")))
- )))
+ ))
(defun bovine-grammar-expand-action (textform quotemode)
"Expand semantic action string TEXTFORM into Lisp code.
@@ -226,7 +228,6 @@ QUOTEMODE is the mode in which quoted symbols are slurred."
(if (string= "" textform)
nil
(let ((sexp (read textform)))
-
;; We converted the lambda string into a list. Now write it
;; out as the bovine lambda expression, and do macro-like
;; conversion upon it.
@@ -339,7 +340,6 @@ manual."
(when (member nterm '("bovine-toplevel" "bovine-inner-scope"))
(error "`%s' is a reserved internal name" nterm))
(insert "\n(" nterm)
-
;; Process each rule
(while rules
(setq items (semantic-tag-get-attribute (car rules) :value)
@@ -375,7 +375,6 @@ manual."
(t
(insert (semantic-grammar-item-text item)))
))))
-
(if prec
(message "%%prec %S ignored" prec))
(if actn
diff --git a/etc/grammars/c.by b/etc/grammars/c.by
index cf8cb0c638..1797827679 100644
--- a/etc/grammars/c.by
+++ b/etc/grammars/c.by
@@ -38,7 +38,7 @@
;; > * Can't parse signature element: "const RmcCmdMCDetailedStatus& status"
;; > * Can't parse signature element: "RmcBucStatus* rftBucStatus"
-%package c-by
+%package semantic-c-by
%languagemode c-mode c++-mode
%start declaration
diff --git a/etc/grammars/java-tags.wy b/etc/grammars/java-tags.wy
index aed39669c5..99d2b9df81 100644
--- a/etc/grammars/java-tags.wy
+++ b/etc/grammars/java-tags.wy
@@ -22,7 +22,7 @@
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-%package java-tags-wy
+%package wisent-java-tags-wy
%languagemode java-mode
@@ -733,17 +733,17 @@ It ignores whitespaces, newlines and comments."
semantic-lex-ignore-newline
semantic-lex-ignore-comments
;;;; Auto-generated analyzers.
- semantic/wisent/java-tags-wy--<number>-regexp-analyzer
- semantic/wisent/java-tags-wy--<string>-sexp-analyzer
+ wisent-java-tags-wy--<number>-regexp-analyzer
+ wisent-java-tags-wy--<string>-sexp-analyzer
;; Must detect keywords before other symbols
- semantic/wisent/java-tags-wy--<keyword>-keyword-analyzer
- semantic/wisent/java-tags-wy--<symbol>-regexp-analyzer
- semantic/wisent/java-tags-wy--<punctuation>-string-analyzer
- semantic/wisent/java-tags-wy--<block>-block-analyzer
+ wisent-java-tags-wy--<keyword>-keyword-analyzer
+ wisent-java-tags-wy--<symbol>-regexp-analyzer
+ wisent-java-tags-wy--<punctuation>-string-analyzer
+ wisent-java-tags-wy--<block>-block-analyzer
;; In theory, unicode chars should be turned into normal chars
;; and then combined into regular ascii keywords and text. This
;; analyzer just keeps these things from making the lexer go boom.
- semantic/wisent/java-tags-wy--<unicode>-regexp-analyzer
+ wisent-java-tags-wy--<unicode>-regexp-analyzer
;;;;
semantic-lex-default-action)
diff --git a/etc/grammars/javascript-jv.wy b/etc/grammars/js.wy
index ba518392ae..a13abf56e6 100644
--- a/etc/grammars/javascript-jv.wy
+++ b/etc/grammars/js.wy
@@ -1,7 +1,7 @@
;;; javascript-jv.wy -- LALR grammar for Javascript
;; Copyright (C) 2005-2011 Free Software Foundation, Inc.
-;; Copyright (C) Ecma International.
+;; Copyright (C) 1998-2011 Ecma International.
;; Author: Joakim Verona
@@ -57,7 +57,7 @@
;; USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
;; DAMAGE.
-%package javascript-jv-wy
+%package wisent-javascript-jv-wy
;; JAVE I prefere ecmascript-mode
%languagemode ecmascript-mode javascript-mode
@@ -509,14 +509,14 @@ OptionalExpression : Expression
semantic-lex-ignore-comments
;;stuff generated from the wy file(one for each "type" declaration)
- semantic/wisent/javascript-jv-wy--<number>-regexp-analyzer
- semantic/wisent/javascript-jv-wy--<string>-sexp-analyzer
+ wisent-javascript-jv-wy--<number>-regexp-analyzer
+ wisent-javascript-jv-wy--<string>-sexp-analyzer
- semantic/wisent/javascript-jv-wy--<keyword>-keyword-analyzer
+ wisent-javascript-jv-wy--<keyword>-keyword-analyzer
- semantic/wisent/javascript-jv-wy--<symbol>-regexp-analyzer
- semantic/wisent/javascript-jv-wy--<punctuation>-string-analyzer
- semantic/wisent/javascript-jv-wy--<block>-block-analyzer
+ wisent-javascript-jv-wy--<symbol>-regexp-analyzer
+ wisent-javascript-jv-wy--<punctuation>-string-analyzer
+ wisent-javascript-jv-wy--<block>-block-analyzer
;;;;more std stuff
diff --git a/etc/grammars/make.by b/etc/grammars/make.by
index 3eb56bf2b4..dab4472b73 100644
--- a/etc/grammars/make.by
+++ b/etc/grammars/make.by
@@ -21,7 +21,7 @@
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-%package make-by
+%package semantic-make-by
%languagemode makefile-mode
%start Makefile
diff --git a/etc/grammars/python.wy b/etc/grammars/python.wy
index 8a7b7771d5..a0af813e5e 100644
--- a/etc/grammars/python.wy
+++ b/etc/grammars/python.wy
@@ -86,7 +86,7 @@
;; Settings
;; --------
-%package python-wy
+%package wisent-python-wy
%languagemode python-mode
diff --git a/etc/grammars/scheme.by b/etc/grammars/scheme.by
index 9e57afe743..bc6612d4c7 100644
--- a/etc/grammars/scheme.by
+++ b/etc/grammars/scheme.by
@@ -17,7 +17,7 @@
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-%package scm-by
+%package semantic-scm-by
%languagemode scheme-mode
%start scheme
diff --git a/etc/grammars/wisent-grammar.el b/etc/grammars/wisent-grammar.el
index 1bef264664..d7de1ee6f7 100644
--- a/etc/grammars/wisent-grammar.el
+++ b/etc/grammars/wisent-grammar.el
@@ -26,8 +26,12 @@
;; Major mode for editing Wisent's input grammar (.wy) files.
;;; Code:
+(require 'semantic)
(require 'semantic/grammar)
(require 'semantic/find)
+(require 'semantic/lex)
+(require 'semantic/wisent)
+(require 'semantic/bovine)
(defsubst wisent-grammar-region-placeholder (symb)
"Given a $N placeholder symbol in SYMB, return a $regionN symbol.