Now on revision 105366. ------------------------------------------------------------ revno: 105366 committer: Chong Yidong branch nick: trunk timestamp: Sat 2011-07-30 20:11:05 -0400 message: Fix copyrights for javascript and python grammars. Since these grammars were transcribed from the ECMAScript spec (BSD licensed) and Python sources (PSL) respectively, the copyright and license notices must be included in these files. diff: === modified file 'etc/grammars/javascript-jv.wy' --- etc/grammars/javascript-jv.wy 2011-07-30 02:06:43 +0000 +++ etc/grammars/javascript-jv.wy 2011-07-31 00:11:05 +0000 @@ -1,38 +1,61 @@ -;;; semantic/wisent/javascript-jv.wy -- LALR grammar for Javascript -;; -;; Copyright (C) 2005 Joakim Verona, Eric Ludlam -;; JAVE Copyright (C) Alex Walker -;; +;;; javascript-jv.wy -- LALR grammar for Javascript + +;; Copyright (C) 2005-2011 Free Software Foundation, Inc. +;; Copyright (C) Ecma International. + ;; Author: Joakim Verona -;; Maintainer: -;; Keywords: syntax -;; -;; This file is not part of GNU Emacs. -;; -;; This program is free software; you can redistribute it and/or -;; modify it under the terms of the GNU General Public License as -;; published by the Free Software Foundation; either version 2, or (at -;; your option) any later version. -;; -;; This software is distributed in the hope that it will be useful, + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;; General Public License for more details. -;; +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. -;; +;; along with GNU Emacs. If not, see . + ;;; Commentary: -;; -;;JAVE converted from a bison javascript definition at: -;; http://www.soton.net/jssyntaxchecker/FinalReport.pdf -;;by Alex Walker -;;and from wisent-javascrypt.wy by Eric Ludlam -;; -;;...and then further modified by Joakim Verona -;;and its more of an experiment than anything useful + +;; The grammar itself is transcribed from the ECMAScript Language +;; Specification published at +;; +;; http://www.ecma-international.org/publications/standards/Ecma-262.htm +;; +;; and redistributed under the following license: + +;; Redistribution and use in source and binary forms, with or without +;; modification, are permitted provided that the following conditions +;; are met: + +;; 1. Redistributions of source code must retain the above copyright +;; notice, this list of conditions and the following disclaimer. + +;; 2. Redistributions in binary form must reproduce the above +;; copyright notice, this list of conditions and the following +;; disclaimer in the documentation and/or other materials provided +;; with the distribution. + +;; 3. Neither the name of the authors nor Ecma International may be +;; used to endorse or promote products derived from this software +;; without specific prior written permission. THIS SOFTWARE IS +;; PROVIDED BY THE ECMA INTERNATIONAL "AS IS" AND ANY EXPRESS OR +;; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +;; ARE DISCLAIMED. IN NO EVENT SHALL ECMA INTERNATIONAL BE LIABLE FOR +;; ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT +;; OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +;; BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +;; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +;; USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +;; DAMAGE. %package javascript-jv-wy ;; JAVE I prefere ecmascript-mode @@ -500,4 +523,4 @@ semantic-lex-default-action ) -;;; semantic/wisent/javascript-jv.wy ends here +;;; javascript-jv.wy ends here === modified file 'etc/grammars/python.wy' --- etc/grammars/python.wy 2011-07-30 21:18:40 +0000 +++ etc/grammars/python.wy 2011-07-31 00:11:05 +0000 @@ -1,7 +1,8 @@ ;;; python.wy -- LALR grammar for Python ;; Copyright (C) 2002-2011 Free Software Foundation, Inc. -;; +;; Copyright (C) 2001-2010 Python Software Foundation + ;; Author: Richard Kim ;; Maintainer: Richard Kim ;; Created: June 2002 @@ -25,8 +26,58 @@ ;;; Commentary: ;; ;; This is an LALR python parser that follows the official python -;; grammar closely with very few exceptions. -;; +;; grammar closely with very few exceptions. The Python grammar is +;; used and reproduced under the following license: +;; +;; PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 +;; -------------------------------------------- +;; 1. This LICENSE AGREEMENT is between the Python Software Foundation +;; ("PSF"), and the Individual or Organization ("Licensee") accessing +;; and otherwise using this software ("Python") in source or binary +;; form and its associated documentation. +;; +;; 2. Subject to the terms and conditions of this License Agreement, +;; PSF hereby grants Licensee a nonexclusive, royalty-free, world-wide +;; license to reproduce, analyze, test, perform and/or display +;; publicly, prepare derivative works, distribute, and otherwise use +;; Python alone or in any derivative version, provided, however, that +;; PSF's License Agreement and PSF's notice of copyright, i.e., +;; "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, +;; 2009, 2010 Python Software Foundation; All Rights Reserved" are +;; retained in Python alone or in any derivative version prepared by +;; Licensee. +;; +;; 3. In the event Licensee prepares a derivative work that is based +;; on or incorporates Python or any part thereof, and wants to make +;; the derivative work available to others as provided herein, then +;; Licensee hereby agrees to include in any such work a brief summary +;; of the changes made to Python. +;; +;; 4. PSF is making Python available to Licensee on an "AS IS" +;; basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +;; IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND +;; DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +;; FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT +;; INFRINGE ANY THIRD PARTY RIGHTS. +;; +;; 5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +;; FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A +;; RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, OR +;; ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. +;; +;; 6. This License Agreement will automatically terminate upon a +;; material breach of its terms and conditions. +;; +;; 7. Nothing in this License Agreement shall be deemed to create any +;; relationship of agency, partnership, or joint venture between PSF +;; and Licensee. This License Agreement does not grant permission to +;; use PSF trademarks or trade name in a trademark sense to endorse or +;; promote products or services of Licensee, or any third party. +;; +;; 8. By copying, installing or otherwise using Python, Licensee +;; agrees to be bound by the terms and conditions of this License +;; Agreement. + ;;; To do: ;; ;; * Verify that semantic-lex-python-number regexp is correct. === modified file 'lisp/cedet/semantic/bovine/c-by.el' --- lisp/cedet/semantic/bovine/c-by.el 2011-01-25 04:08:28 +0000 +++ lisp/cedet/semantic/bovine/c-by.el 2011-07-31 00:11:05 +0000 @@ -19,8 +19,7 @@ ;;; Commentary: ;; -;; This file was generated from the grammar file semantic/bovine/c.by -;; in the CEDET repository. +;; This file was generated from etc/grammars/c.by. ;;; Code: === modified file 'lisp/cedet/semantic/bovine/make-by.el' --- lisp/cedet/semantic/bovine/make-by.el 2011-01-26 08:36:39 +0000 +++ lisp/cedet/semantic/bovine/make-by.el 2011-07-31 00:11:05 +0000 @@ -19,8 +19,7 @@ ;;; Commentary: ;; -;; This file was generated from the grammar file -;; semantic/bovine/make.by in the CEDET repository. +;; This file was generated from etc/grammars/make.by. ;;; Code: === modified file 'lisp/cedet/semantic/bovine/scm-by.el' --- lisp/cedet/semantic/bovine/scm-by.el 2011-01-25 04:08:28 +0000 +++ lisp/cedet/semantic/bovine/scm-by.el 2011-07-31 00:11:05 +0000 @@ -19,8 +19,7 @@ ;;; Commentary: ;; -;; This file was generated from the grammar file -;; semantic/bovine/scm.by in the CEDET repository. +;; This file was generated from etc/grammars/scm.by. ;;; Code: === modified file 'lisp/cedet/semantic/wisent/javat-wy.el' --- lisp/cedet/semantic/wisent/javat-wy.el 2011-01-25 04:08:28 +0000 +++ lisp/cedet/semantic/wisent/javat-wy.el 2011-07-31 00:11:05 +0000 @@ -19,8 +19,7 @@ ;;; Commentary: ;; -;; This file was generated from the grammar file -;; semantic/wisent/wisent-java-tags.wy in the CEDET repository. +;; This file was generated from etc/java-tags.wy. ;;; Code: === modified file 'lisp/cedet/semantic/wisent/js-wy.el' --- lisp/cedet/semantic/wisent/js-wy.el 2011-01-25 04:08:28 +0000 +++ lisp/cedet/semantic/wisent/js-wy.el 2011-07-31 00:11:05 +0000 @@ -1,6 +1,7 @@ ;;; semantic/wisent/js-wy.el --- Generated parser support file ;; Copyright (C) 2005, 2009-2011 Free Software Foundation, Inc. +;; Copyright (C) Ecma International. ;; This file is part of GNU Emacs. @@ -19,8 +20,7 @@ ;;; Commentary: ;; -;; This file was generated from the grammar file -;; semantic/wisent/wisent-javascript-jv.wy in the CEDET repository. +;; This file was generated from etc/grammars/javascript-jv.wy. ;;; Code: (require 'semantic/lex) === modified file 'lisp/cedet/semantic/wisent/python-wy.el' --- lisp/cedet/semantic/wisent/python-wy.el 2011-01-26 08:36:39 +0000 +++ lisp/cedet/semantic/wisent/python-wy.el 2011-07-31 00:11:05 +0000 @@ -1,6 +1,7 @@ ;;; semantic/wisent/python-wy.el --- Generated parser support file ;; Copyright (C) 2002-2004, 2007, 2010-2011 Free Software Foundation, Inc. +;; Copyright (C) 2001-2010 Python Software Foundation ;; This file is part of GNU Emacs. @@ -19,8 +20,7 @@ ;;; Commentary: ;; -;; This file was generated from the grammar file -;; semantic/wisent/wisent-python.wy in the CEDET repository. +;; This file was generated from etc/grammars/python.wy. ;;; Code: ------------------------------------------------------------ revno: 105365 committer: Chong Yidong branch nick: trunk timestamp: Sat 2011-07-30 17:18:40 -0400 message: Fix copyright headers for grammar files authored by Eric M. Ludlam, David Ponce, and Klaus Berndl (assignments on file). diff: === modified file 'etc/grammars/bovine-grammar.el' --- etc/grammars/bovine-grammar.el 2011-07-30 02:06:43 +0000 +++ etc/grammars/bovine-grammar.el 2011-07-30 21:18:40 +0000 @@ -436,4 +436,4 @@ (provide 'semantic/bovine/grammar) -;;; semantic/bovine/grammar.el ends here +;;; bovine-grammar.el ends here === modified file 'etc/grammars/c.by' --- etc/grammars/c.by 2011-07-30 02:06:43 +0000 +++ etc/grammars/c.by 2011-07-30 21:18:40 +0000 @@ -1,28 +1,25 @@ -;;; semantic/bovine/c.by -- LL grammar for C/C++ language specification -;; -;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Eric M. Ludlam -;; Copyright (C) 2002, 2003 David Ponce +;;; c.by -- LL grammar for C/C++ language specification + +;; Copyright (C) 1999-2011 Free Software Foundation, Inc. ;; ;; Author: Eric M. Ludlam ;; David Ponce ;; Klaus Berndl ;; -;; -;; This program is free software; you can redistribute it and/or modify +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. -;; -;; This software is distributed in the hope that it will be useful, +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. -;; + ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. -;; +;; along with GNU Emacs. If not, see . ;; TODO: From Nate Schley ;; > * Can't parse signature element: "const char* const rmc_ClrTxt" @@ -1202,4 +1199,4 @@ | expr-start expression ; -;;; semantic/bovine/c.by ends here +;;; c.by ends here === modified file 'etc/grammars/java-tags.wy' --- etc/grammars/java-tags.wy 2011-07-30 02:06:43 +0000 +++ etc/grammars/java-tags.wy 2011-07-30 21:18:40 +0000 @@ -1,29 +1,26 @@ -;;; semantic/wisent/java-tags.wy -- Semantic LALR grammar for Java -;; -;; Copyright (C) 2002, 2007 David Ponce -;; Copyright (C) 2007 Eric Ludlam +;;; java-tags.wy -- Semantic LALR grammar for Java + +;; Copyright (C) 2002-2011 Free Software Foundation, Inc. ;; ;; Author: David Ponce ;; Maintainer: David Ponce -;; Created: 25 Feb 2002 +;; Created: 26 Aug 2002 ;; Keywords: syntax -;; -;; This file is not part of GNU Emacs. -;; -;; This program is free software; you can redistribute it and/or -;; modify it under the terms of the GNU General Public License as -;; published by the Free Software Foundation; either version 2, or (at -;; your option) any later version. -;; -;; This software is distributed in the hope that it will be useful, + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;; General Public License for more details. -;; +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. +;; along with GNU Emacs. If not, see . %package java-tags-wy @@ -750,4 +747,4 @@ ;;;; semantic-lex-default-action) -;;; semantic/wisent/java-tags.wy ends here +;;; java-tags.wy ends here === modified file 'etc/grammars/make.by' --- etc/grammars/make.by 2011-07-30 02:06:43 +0000 +++ etc/grammars/make.by 2011-07-30 21:18:40 +0000 @@ -1,24 +1,25 @@ -;;; semantic/bovine/make.by -- BY notation for Makefiles. -;; -;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2008 Eric M. Ludlam +;;; make.by -- BY notation for Makefiles. + +;; Copyright (C) 1999-2011 Free Software Foundation, Inc. ;; ;; Author: Eric M. Ludlam +;; David Ponce +;; Klaus Berndl ;; -;; This program is free software; you can redistribute it and/or modify +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. -;; -;; This software is distributed in the hope that it will be useful, +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. -;; + ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. -;; +;; along with GNU Emacs. If not, see . %package make-by @@ -164,4 +165,4 @@ | whitespace (nil) ; -;;; semantic/bovine/make.by ends here +;;; make.by ends here === modified file 'etc/grammars/python.wy' --- etc/grammars/python.wy 2011-07-30 02:06:43 +0000 +++ etc/grammars/python.wy 2011-07-30 21:18:40 +0000 @@ -1,28 +1,26 @@ -;;; semantic/wisent/python.wy -- LALR grammar for Python -;; -;; Copyright (C) 2002, 2003, 2004, 2007 Richard Kim +;;; python.wy -- LALR grammar for Python + +;; Copyright (C) 2002-2011 Free Software Foundation, Inc. ;; ;; Author: Richard Kim ;; Maintainer: Richard Kim ;; Created: June 2002 ;; Keywords: syntax ;; -;; This file is not part of GNU Emacs. -;; -;; This program is free software; you can redistribute it and/or -;; modify it under the terms of the GNU General Public License as -;; published by the Free Software Foundation; either version 2, or (at -;; your option) any later version. -;; -;; This software is distributed in the hope that it will be useful, +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;; General Public License for more details. -;; +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. +;; along with GNU Emacs. If not, see . ;;; Commentary: ;; @@ -1080,4 +1078,4 @@ | SEMICOLON ; -;;; semantic/wisent/python.wy ends here +;;; python.wy ends here === modified file 'etc/grammars/scheme.by' --- etc/grammars/scheme.by 2011-07-30 02:06:43 +0000 +++ etc/grammars/scheme.by 2011-07-30 21:18:40 +0000 @@ -1,23 +1,21 @@ -;;; semantic/bovine/scheme.by -- Scheme BNF language specification -;; -;; Copyright (C) 2001, 2003, 2009 Eric M. Ludlam -;; -;; Author: Eric M. Ludlam -;; -;; This is free software; you can redistribute it and/or modify +;;; scheme.by -- Scheme BNF language specification + +;; Copyright (C) 2001-2011 Free Software Foundation, Inc. + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. -;; -;; This software is distributed in the hope that it will be useful, +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. -;; + ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. +;; along with GNU Emacs. If not, see . %package scm-by @@ -83,4 +81,4 @@ | number ; -;;; semantic/bovine/scheme.by ends here +;;; scheme.by ends here ------------------------------------------------------------ revno: 105364 committer: Carsten Dominik branch nick: trunk timestamp: Sat 2011-07-30 18:29:20 +0200 message: Fix regexp for finding code blocks diff: === modified file 'lisp/org/ChangeLog' --- lisp/org/ChangeLog 2011-07-29 06:47:56 +0000 +++ lisp/org/ChangeLog 2011-07-30 16:29:20 +0000 @@ -1,3 +1,8 @@ +2011-07-30 Carsten Dominik + + * ob.el (org-babel-src-block-regexp): If a code block has a body, + its last character must be a newline. + 2011-07-28 Bastien Guerry * org-publish.el (org-publish-index-generate-theindex): rename === modified file 'lisp/org/ob.el' --- lisp/org/ob.el 2011-07-28 15:13:49 +0000 +++ lisp/org/ob.el 2011-07-30 16:29:20 +0000 @@ -137,7 +137,7 @@ ;; (4) header arguments "\\([^\n]*\\)\n" ;; (5) body - "\\([^\000]*?\\)[ \t]*#\\+end_src") + "\\([^\000]*?\n\\)?[ \t]*#\\+end_src") "Regexp used to identify code blocks.") (defvar org-babel-inline-src-block-regexp ------------------------------------------------------------ revno: 105363 committer: Michael Albinus branch nick: trunk timestamp: Sat 2011-07-30 17:50:56 +0200 message: * mini.texi (Minibuffer File): Insert a reference to Tramp for remote file name completion. (Bug#9197) diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2011-07-28 17:18:25 +0000 +++ doc/emacs/ChangeLog 2011-07-30 15:50:56 +0000 @@ -1,3 +1,8 @@ +2011-07-30 Michael Albinus + + * mini.texi (Minibuffer File): Insert a reference to Tramp for + remote file name completion. (Bug#9197) + 2011-07-28 Eli Zaretskii * mule.texi (Bidirectional Editing): Document the fact that === modified file 'doc/emacs/mini.texi' --- doc/emacs/mini.texi 2011-05-17 02:26:56 +0000 +++ doc/emacs/mini.texi 2011-07-30 15:50:56 +0000 @@ -125,6 +125,10 @@ Nonetheless, relative file name arguments are still interpreted based on the same default directory. + For rules how to read remote file names in the minibuffer, see +@ref{Filename completion, file name completion,, tramp}, in the Tramp +manual. + @node Minibuffer Edit @section Editing in the Minibuffer @@ -491,7 +495,7 @@ Move to the next item in the minibuffer history (@code{next-history-element}). @item M-r @var{regexp} @key{RET} -Move to an earlier item in the minibuffer history that +Move to an earlier item in the minibuffer history that matches @var{regexp} (@code{previous-matching-history-element}). @item M-s @var{regexp} @key{RET} Move to a later item in the minibuffer history that matches ------------------------------------------------------------ revno: 105362 committer: Michael Albinus branch nick: trunk timestamp: Sat 2011-07-30 16:59:27 +0200 message: Sync with Tramp 2.2.2. * trampver.texi: Update release number. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2011-07-28 15:13:49 +0000 +++ doc/misc/ChangeLog 2011-07-30 14:59:27 +0000 @@ -1,3 +1,9 @@ +2011-07-30 Michael Albinus + + Sync with Tramp 2.2.2. + + * trampver.texi: Update release number. + 2011-07-28 Bastien Guerry * org.texi (Using the mapping API): mention 'region as a possible === modified file 'doc/misc/trampver.texi' --- doc/misc/trampver.texi 2011-04-25 18:14:38 +0000 +++ doc/misc/trampver.texi 2011-07-30 14:59:27 +0000 @@ -8,7 +8,7 @@ @c In the Tramp CVS, the version number is auto-frobbed from @c configure.ac, so you should edit that file and run @c "autoconf && ./configure" to change the version number. -@set trampver 2.2.2-pre +@set trampver 2.2.2 @c Other flags from configuration @set instprefix /usr/local ------------------------------------------------------------ revno: 105361 committer: Michael Albinus branch nick: trunk timestamp: Sat 2011-07-30 16:57:12 +0200 message: Sync with Tramp 2.2.2. * net/trampver.el: Update release number. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-07-30 09:14:58 +0000 +++ lisp/ChangeLog 2011-07-30 14:57:12 +0000 @@ -1,3 +1,9 @@ +2011-07-30 Michael Albinus + + Sync with Tramp 2.2.2. + + * net/trampver.el: Update release number. + 2011-07-30 Juri Linkov * dired-aux.el (dired-touch-initial): Remove function. === modified file 'lisp/net/trampver.el' --- lisp/net/trampver.el 2011-04-25 18:10:17 +0000 +++ lisp/net/trampver.el 2011-07-30 14:57:12 +0000 @@ -31,7 +31,7 @@ ;; should be changed only there. ;;;###tramp-autoload -(defconst tramp-version "2.2.2-pre" +(defconst tramp-version "2.2.2" "This version of Tramp.") ;;;###tramp-autoload @@ -44,7 +44,7 @@ (= emacs-major-version 21) (>= emacs-minor-version 4))) "ok" - (format "Tramp 2.2.2-pre is not fit for %s" + (format "Tramp 2.2.2 is not fit for %s" (when (string-match "^.*$" (emacs-version)) (match-string 0 (emacs-version))))))) (unless (string-match "\\`ok\\'" x) (error "%s" x))) ------------------------------------------------------------ revno: 105360 committer: Andreas Schwab branch nick: emacs timestamp: Sat 2011-07-30 15:20:04 +0200 message: * src/regex.c (re_comp): Protoize. (re_exec): Fix return type. (regexec): Fix type of `ret'. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-07-29 07:05:17 +0000 +++ src/ChangeLog 2011-07-30 13:20:04 +0000 @@ -1,3 +1,9 @@ +2011-07-30 Andreas Schwab + + * regex.c (re_comp): Protoize. + (re_exec): Fix return type. + (regexec): Fix type of `ret'. (Bug#9203) + 2011-07-29 Paul Eggert * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189). === modified file 'src/regex.c' --- src/regex.c 2011-07-28 09:34:13 +0000 +++ src/regex.c 2011-07-30 13:20:04 +0000 @@ -6381,8 +6381,7 @@ regcomp/regexec below without link errors. */ weak_function # endif -re_comp (s) - const char *s; +re_comp (const char *s) { reg_errcode_t ret; @@ -6421,7 +6420,7 @@ } -regoff_t +int # ifdef _LIBC weak_function # endif @@ -6558,7 +6557,7 @@ regexec (const regex_t *__restrict preg, const char *__restrict string, size_t nmatch, regmatch_t pmatch[__restrict_arr], int eflags) { - reg_errcode_t ret; + regoff_t ret; struct re_registers regs; regex_t private_preg; size_t len = strlen (string); ------------------------------------------------------------ revno: 105359 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2011-07-30 13:38:12 +0300 message: Restore history of lisp/org/org-pcomplete.el. diff: === added file 'lisp/org/org-pcomplete.el' --- lisp/org/org-pcomplete.el 1970-01-01 00:00:00 +0000 +++ lisp/org/org-pcomplete.el 2011-07-30 10:38:12 +0000 @@ -0,0 +1,282 @@ +;;; org-pcomplete.el --- In-buffer completion code + +;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 +;; Free Software Foundation, Inc. +;; +;; Author: Carsten Dominik +;; John Wiegley +;; Keywords: outlines, hypermedia, calendar, wp +;; Homepage: http://orgmode.org +;; Version: 7.7 +;; +;; This file is part of GNU Emacs. +;; +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;;; Code: + +;;;; Require other packages + +(eval-when-compile + (require 'cl)) + +(require 'org-macs) +(require 'pcomplete) + +(declare-function org-split-string "org" (string &optional separators)) +(declare-function org-get-current-options "org-exp" ()) +(declare-function org-make-org-heading-search-string "org" + (&optional string heading)) +(declare-function org-get-buffer-tags "org" ()) +(declare-function org-get-tags "org" ()) +(declare-function org-buffer-property-keys "org" + (&optional include-specials include-defaults include-columns)) +(declare-function org-entry-properties "org" (&optional pom which specific)) + +;;;; Customization variables + +(defgroup org-complete nil + "Outline-based notes management and organizer." + :tag "Org" + :group 'org) + +(defun org-thing-at-point () + "Examine the thing at point and let the caller know what it is. +The return value is a string naming the thing at point." + (let ((beg1 (save-excursion + (skip-chars-backward (org-re "[:alnum:]_@")) + (point))) + (beg (save-excursion + (skip-chars-backward "a-zA-Z0-9_:$") + (point))) + (line-to-here (buffer-substring (point-at-bol) (point)))) + (cond + ((string-match "\\`[ \t]*#\\+begin: clocktable[ \t]+" line-to-here) + (cons "block-option" "clocktable")) + ((string-match "\\`[ \t]*#\\+begin_src[ \t]+" line-to-here) + (cons "block-option" "src")) + ((save-excursion + (re-search-backward "^[ \t]*#\\+\\([A-Z_]+\\):.*" + (line-beginning-position) t)) + (cons "file-option" (match-string-no-properties 1))) + ((string-match "\\`[ \t]*#\\+[a-zA-Z]*\\'" line-to-here) + (cons "file-option" nil)) + ((equal (char-before beg) ?\[) + (cons "link" nil)) + ((equal (char-before beg) ?\\) + (cons "tex" nil)) + ((string-match "\\`\\*+[ \t]+\\'" + (buffer-substring (point-at-bol) beg)) + (cons "todo" nil)) + ((equal (char-before beg) ?*) + (cons "searchhead" nil)) + ((and (equal (char-before beg1) ?:) + (equal (char-after (point-at-bol)) ?*)) + (cons "tag" nil)) + ((and (equal (char-before beg1) ?:) + (not (equal (char-after (point-at-bol)) ?*))) + (cons "prop" nil)) + (t nil)))) + +(defun org-command-at-point () + "Return the qualified name of the Org completion entity at point. +When completing for #+STARTUP, for example, this function returns +\"file-option/startup\"." + (let ((thing (org-thing-at-point))) + (cond + ((string= "file-option" (car thing)) + (concat (car thing) "/" (downcase (cdr thing)))) + ((string= "block-option" (car thing)) + (concat (car thing) "/" (downcase (cdr thing)))) + (t + (car thing))))) + +(defun org-parse-arguments () + "Parse whitespace separated arguments in the current region." + (let ((begin (line-beginning-position)) + (end (line-end-position)) + begins args) + (save-restriction + (narrow-to-region begin end) + (save-excursion + (goto-char (point-min)) + (while (not (eobp)) + (skip-chars-forward " \t\n[") + (setq begins (cons (point) begins)) + (skip-chars-forward "^ \t\n[") + (setq args (cons (buffer-substring-no-properties + (car begins) (point)) + args))) + (cons (reverse args) (reverse begins)))))) + + +(defun org-pcomplete-initial () + "Calls the right completion function for first argument completions." + (ignore + (funcall (or (pcomplete-find-completion-function + (car (org-thing-at-point))) + pcomplete-default-completion-function)))) + +(defvar org-additional-option-like-keywords) +(defun pcomplete/org-mode/file-option () + "Complete against all valid file options." + (require 'org-exp) + (pcomplete-here + (org-pcomplete-case-double + (mapcar (lambda (x) + (if (= ?: (aref x (1- (length x)))) + (concat x " ") + x)) + (delq nil + (pcomplete-uniqify-list + (append + (mapcar (lambda (x) + (if (string-match "^#\\+\\([A-Z_]+:?\\)" x) + (match-string 1 x))) + (org-split-string (org-get-current-options) "\n")) + org-additional-option-like-keywords))))) + (substring pcomplete-stub 2))) + +(defvar org-startup-options) +(defun pcomplete/org-mode/file-option/startup () + "Complete arguments for the #+STARTUP file option." + (while (pcomplete-here + (let ((opts (pcomplete-uniqify-list + (mapcar 'car org-startup-options)))) + ;; Some options are mutually exclusive, and shouldn't be completed + ;; against if certain other options have already been seen. + (dolist (arg pcomplete-args) + (cond + ((string= arg "hidestars") + (setq opts (delete "showstars" opts))))) + opts)))) + +(defun pcomplete/org-mode/file-option/bind () + "Complete arguments for the #+BIND file option, which are variable names" + (let (vars) + (mapatoms + (lambda (a) (if (boundp a) (setq vars (cons (symbol-name a) vars))))) + (pcomplete-here vars))) + +(defvar org-link-abbrev-alist-local) +(defvar org-link-abbrev-alist) +(defun pcomplete/org-mode/link () + "Complete against defined #+LINK patterns." + (pcomplete-here + (pcomplete-uniqify-list + (copy-sequence + (append (mapcar 'car org-link-abbrev-alist-local) + (mapcar 'car org-link-abbrev-alist)))))) + +(defvar org-entities) +(defun pcomplete/org-mode/tex () + "Complete against TeX-style HTML entity names." + (require 'org-entities) + (while (pcomplete-here + (pcomplete-uniqify-list (remove nil (mapcar 'car-safe org-entities))) + (substring pcomplete-stub 1)))) + +(defvar org-todo-keywords-1) +(defun pcomplete/org-mode/todo () + "Complete against known TODO keywords." + (pcomplete-here (pcomplete-uniqify-list (copy-sequence org-todo-keywords-1)))) + +(defvar org-todo-line-regexp) +(defun pcomplete/org-mode/searchhead () + "Complete against all headings. +This needs more work, to handle headings with lots of spaces in them." + (while + (pcomplete-here + (save-excursion + (goto-char (point-min)) + (let (tbl) + (while (re-search-forward org-todo-line-regexp nil t) + (push (org-make-org-heading-search-string + (match-string-no-properties 3) t) + tbl)) + (pcomplete-uniqify-list tbl))) + (substring pcomplete-stub 1)))) + +(defvar org-tag-alist) +(defun pcomplete/org-mode/tag () + "Complete a tag name. Omit tags already set." + (while (pcomplete-here + (mapcar (lambda (x) + (concat x ":")) + (let ((lst (pcomplete-uniqify-list + (or (remove + nil + (mapcar (lambda (x) + (and (stringp (car x)) (car x))) + org-tag-alist)) + (mapcar 'car (org-get-buffer-tags)))))) + (dolist (tag (org-get-tags)) + (setq lst (delete tag lst))) + lst)) + (and (string-match ".*:" pcomplete-stub) + (substring pcomplete-stub (match-end 0)))))) + +(defun pcomplete/org-mode/prop () + "Complete a property name. Omit properties already set." + (pcomplete-here + (mapcar (lambda (x) + (concat x ": ")) + (let ((lst (pcomplete-uniqify-list + (copy-sequence + (org-buffer-property-keys nil t t))))) + (dolist (prop (org-entry-properties)) + (setq lst (delete (car prop) lst))) + lst)) + (substring pcomplete-stub 1))) + +(defun pcomplete/org-mode/block-option/src () + "Complete the arguments of a begin_src block. +Complete a language in the first field, the header arguments and switches." + (pcomplete-here + (mapcar + (lambda(x) (symbol-name (nth 3 x))) + (cdr (car (cdr (memq :key-type (plist-get + (symbol-plist + 'org-babel-load-languages) + 'custom-type))))))) + (while (pcomplete-here + '("-n" "-r" "-l" + ":cache" ":colnames" ":comments" ":dir" ":eval" ":exports" + ":file" ":hlines" ":no-expand" ":noweb" ":results" ":rownames" + ":session" ":shebang" ":tangle" ":var")))) + +(defun pcomplete/org-mode/block-option/clocktable () + "Complete keywords in a clocktable line" + (while (pcomplete-here '(":maxlevel" ":scope" + ":tstart" ":tend" ":block" ":step" + ":stepskip0" ":fileskip0" + ":emphasize" ":link" ":narrow" ":indent" + ":tcolumns" ":level" ":compact" ":timestamp" + ":formula" ":formatter")))) + +(defun org-pcomplete-case-double (list) + "Return list with both upcase and downcase version of all strings in LIST." + (let (e res) + (while (setq e (pop list)) + (setq res (cons (downcase e) (cons (upcase e) res)))) + (nreverse res))) + +;;;; Finish up + +(provide 'org-pcomplete) + +;; arch-tag: + +;;; org-pcomplete.el ends here === removed file 'lisp/org/org-pcomplete.el' --- lisp/org/org-pcomplete.el 2011-07-28 15:13:49 +0000 +++ lisp/org/org-pcomplete.el 1970-01-01 00:00:00 +0000 @@ -1,282 +0,0 @@ -;;; org-pcomplete.el --- In-buffer completion code - -;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 -;; Free Software Foundation, Inc. -;; -;; Author: Carsten Dominik -;; John Wiegley -;; Keywords: outlines, hypermedia, calendar, wp -;; Homepage: http://orgmode.org -;; Version: 7.7 -;; -;; This file is part of GNU Emacs. -;; -;; GNU Emacs is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; GNU Emacs is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see . -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;;; Code: - -;;;; Require other packages - -(eval-when-compile - (require 'cl)) - -(require 'org-macs) -(require 'pcomplete) - -(declare-function org-split-string "org" (string &optional separators)) -(declare-function org-get-current-options "org-exp" ()) -(declare-function org-make-org-heading-search-string "org" - (&optional string heading)) -(declare-function org-get-buffer-tags "org" ()) -(declare-function org-get-tags "org" ()) -(declare-function org-buffer-property-keys "org" - (&optional include-specials include-defaults include-columns)) -(declare-function org-entry-properties "org" (&optional pom which specific)) - -;;;; Customization variables - -(defgroup org-complete nil - "Outline-based notes management and organizer." - :tag "Org" - :group 'org) - -(defun org-thing-at-point () - "Examine the thing at point and let the caller know what it is. -The return value is a string naming the thing at point." - (let ((beg1 (save-excursion - (skip-chars-backward (org-re "[:alnum:]_@")) - (point))) - (beg (save-excursion - (skip-chars-backward "a-zA-Z0-9_:$") - (point))) - (line-to-here (buffer-substring (point-at-bol) (point)))) - (cond - ((string-match "\\`[ \t]*#\\+begin: clocktable[ \t]+" line-to-here) - (cons "block-option" "clocktable")) - ((string-match "\\`[ \t]*#\\+begin_src[ \t]+" line-to-here) - (cons "block-option" "src")) - ((save-excursion - (re-search-backward "^[ \t]*#\\+\\([A-Z_]+\\):.*" - (line-beginning-position) t)) - (cons "file-option" (match-string-no-properties 1))) - ((string-match "\\`[ \t]*#\\+[a-zA-Z]*\\'" line-to-here) - (cons "file-option" nil)) - ((equal (char-before beg) ?\[) - (cons "link" nil)) - ((equal (char-before beg) ?\\) - (cons "tex" nil)) - ((string-match "\\`\\*+[ \t]+\\'" - (buffer-substring (point-at-bol) beg)) - (cons "todo" nil)) - ((equal (char-before beg) ?*) - (cons "searchhead" nil)) - ((and (equal (char-before beg1) ?:) - (equal (char-after (point-at-bol)) ?*)) - (cons "tag" nil)) - ((and (equal (char-before beg1) ?:) - (not (equal (char-after (point-at-bol)) ?*))) - (cons "prop" nil)) - (t nil)))) - -(defun org-command-at-point () - "Return the qualified name of the Org completion entity at point. -When completing for #+STARTUP, for example, this function returns -\"file-option/startup\"." - (let ((thing (org-thing-at-point))) - (cond - ((string= "file-option" (car thing)) - (concat (car thing) "/" (downcase (cdr thing)))) - ((string= "block-option" (car thing)) - (concat (car thing) "/" (downcase (cdr thing)))) - (t - (car thing))))) - -(defun org-parse-arguments () - "Parse whitespace separated arguments in the current region." - (let ((begin (line-beginning-position)) - (end (line-end-position)) - begins args) - (save-restriction - (narrow-to-region begin end) - (save-excursion - (goto-char (point-min)) - (while (not (eobp)) - (skip-chars-forward " \t\n[") - (setq begins (cons (point) begins)) - (skip-chars-forward "^ \t\n[") - (setq args (cons (buffer-substring-no-properties - (car begins) (point)) - args))) - (cons (reverse args) (reverse begins)))))) - - -(defun org-pcomplete-initial () - "Calls the right completion function for first argument completions." - (ignore - (funcall (or (pcomplete-find-completion-function - (car (org-thing-at-point))) - pcomplete-default-completion-function)))) - -(defvar org-additional-option-like-keywords) -(defun pcomplete/org-mode/file-option () - "Complete against all valid file options." - (require 'org-exp) - (pcomplete-here - (org-pcomplete-case-double - (mapcar (lambda (x) - (if (= ?: (aref x (1- (length x)))) - (concat x " ") - x)) - (delq nil - (pcomplete-uniqify-list - (append - (mapcar (lambda (x) - (if (string-match "^#\\+\\([A-Z_]+:?\\)" x) - (match-string 1 x))) - (org-split-string (org-get-current-options) "\n")) - org-additional-option-like-keywords))))) - (substring pcomplete-stub 2))) - -(defvar org-startup-options) -(defun pcomplete/org-mode/file-option/startup () - "Complete arguments for the #+STARTUP file option." - (while (pcomplete-here - (let ((opts (pcomplete-uniqify-list - (mapcar 'car org-startup-options)))) - ;; Some options are mutually exclusive, and shouldn't be completed - ;; against if certain other options have already been seen. - (dolist (arg pcomplete-args) - (cond - ((string= arg "hidestars") - (setq opts (delete "showstars" opts))))) - opts)))) - -(defun pcomplete/org-mode/file-option/bind () - "Complete arguments for the #+BIND file option, which are variable names" - (let (vars) - (mapatoms - (lambda (a) (if (boundp a) (setq vars (cons (symbol-name a) vars))))) - (pcomplete-here vars))) - -(defvar org-link-abbrev-alist-local) -(defvar org-link-abbrev-alist) -(defun pcomplete/org-mode/link () - "Complete against defined #+LINK patterns." - (pcomplete-here - (pcomplete-uniqify-list - (copy-sequence - (append (mapcar 'car org-link-abbrev-alist-local) - (mapcar 'car org-link-abbrev-alist)))))) - -(defvar org-entities) -(defun pcomplete/org-mode/tex () - "Complete against TeX-style HTML entity names." - (require 'org-entities) - (while (pcomplete-here - (pcomplete-uniqify-list (remove nil (mapcar 'car-safe org-entities))) - (substring pcomplete-stub 1)))) - -(defvar org-todo-keywords-1) -(defun pcomplete/org-mode/todo () - "Complete against known TODO keywords." - (pcomplete-here (pcomplete-uniqify-list (copy-sequence org-todo-keywords-1)))) - -(defvar org-todo-line-regexp) -(defun pcomplete/org-mode/searchhead () - "Complete against all headings. -This needs more work, to handle headings with lots of spaces in them." - (while - (pcomplete-here - (save-excursion - (goto-char (point-min)) - (let (tbl) - (while (re-search-forward org-todo-line-regexp nil t) - (push (org-make-org-heading-search-string - (match-string-no-properties 3) t) - tbl)) - (pcomplete-uniqify-list tbl))) - (substring pcomplete-stub 1)))) - -(defvar org-tag-alist) -(defun pcomplete/org-mode/tag () - "Complete a tag name. Omit tags already set." - (while (pcomplete-here - (mapcar (lambda (x) - (concat x ":")) - (let ((lst (pcomplete-uniqify-list - (or (remove - nil - (mapcar (lambda (x) - (and (stringp (car x)) (car x))) - org-tag-alist)) - (mapcar 'car (org-get-buffer-tags)))))) - (dolist (tag (org-get-tags)) - (setq lst (delete tag lst))) - lst)) - (and (string-match ".*:" pcomplete-stub) - (substring pcomplete-stub (match-end 0)))))) - -(defun pcomplete/org-mode/prop () - "Complete a property name. Omit properties already set." - (pcomplete-here - (mapcar (lambda (x) - (concat x ": ")) - (let ((lst (pcomplete-uniqify-list - (copy-sequence - (org-buffer-property-keys nil t t))))) - (dolist (prop (org-entry-properties)) - (setq lst (delete (car prop) lst))) - lst)) - (substring pcomplete-stub 1))) - -(defun pcomplete/org-mode/block-option/src () - "Complete the arguments of a begin_src block. -Complete a language in the first field, the header arguments and switches." - (pcomplete-here - (mapcar - (lambda(x) (symbol-name (nth 3 x))) - (cdr (car (cdr (memq :key-type (plist-get - (symbol-plist - 'org-babel-load-languages) - 'custom-type))))))) - (while (pcomplete-here - '("-n" "-r" "-l" - ":cache" ":colnames" ":comments" ":dir" ":eval" ":exports" - ":file" ":hlines" ":no-expand" ":noweb" ":results" ":rownames" - ":session" ":shebang" ":tangle" ":var")))) - -(defun pcomplete/org-mode/block-option/clocktable () - "Complete keywords in a clocktable line" - (while (pcomplete-here '(":maxlevel" ":scope" - ":tstart" ":tend" ":block" ":step" - ":stepskip0" ":fileskip0" - ":emphasize" ":link" ":narrow" ":indent" - ":tcolumns" ":level" ":compact" ":timestamp" - ":formula" ":formatter")))) - -(defun org-pcomplete-case-double (list) - "Return list with both upcase and downcase version of all strings in LIST." - (let (e res) - (while (setq e (pop list)) - (setq res (cons (downcase e) (cons (upcase e) res)))) - (nreverse res))) - -;;;; Finish up - -(provide 'org-pcomplete) - -;; arch-tag: - -;;; org-pcomplete.el ends here ------------------------------------------------------------ revno: 105358 committer: Glenn Morris branch nick: trunk timestamp: Sat 2011-07-30 06:18:37 -0400 message: Auto-commit of loaddefs files. diff: === modified file 'lisp/dired.el' --- lisp/dired.el 2011-07-13 21:27:13 +0000 +++ lisp/dired.el 2011-07-30 10:18:37 +0000 @@ -3663,7 +3663,7 @@ ;;;;;; dired-run-shell-command dired-do-shell-command dired-do-async-shell-command ;;;;;; dired-clean-directory dired-do-print dired-do-touch dired-do-chown ;;;;;; dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff -;;;;;; dired-diff) "dired-aux" "dired-aux.el" "ab62f310329f404f96a29e4f0ab8df73") +;;;;;; dired-diff) "dired-aux" "dired-aux.el" "bbb53a5b6bf56c413fe0f898559bef8d") ;;; Generated autoloads from dired-aux.el (autoload 'dired-diff "dired-aux" "\ ------------------------------------------------------------ revno: 105357 fixes bug(s): http://debbugs.gnu.org/6887 committer: Juri Linkov branch nick: trunk timestamp: Sat 2011-07-30 12:14:58 +0300 message: * lisp/dired-aux.el (dired-touch-initial): Remove function. (dired-do-chxxx): For op-symbol `touch', set `initial' to the current time, and `default' to the last modification time of the current marked file. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-07-28 14:05:07 +0000 +++ lisp/ChangeLog 2011-07-30 09:14:58 +0000 @@ -1,7 +1,14 @@ +2011-07-30 Juri Linkov + + * dired-aux.el (dired-touch-initial): Remove function. + (dired-do-chxxx): For op-symbol `touch', set `initial' to the + current time, and `default' to the last modification time of the + current marked file (bug#6887). + 2011-07-28 Jose E. Marchesi * simple.el (goto-line): Use string-to-number to provide a - numeric argument to read-number. + numeric argument to read-number (bug#9163). 2011-07-27 Michael Albinus === modified file 'lisp/dired-aux.el' --- lisp/dired-aux.el 2011-07-12 02:54:26 +0000 +++ lisp/dired-aux.el 2011-07-30 09:14:58 +0000 @@ -226,34 +226,28 @@ (file-attributes full-file-name)))) (directory-files dir))) - -(defun dired-touch-initial (files) - "Create initial input value for `touch' command." - ;; Nobody can explain what this version is supposed to do. (Bug#6887) - ;; Also, the manual says it uses "the present time". - ;;; (let (initial) - ;;; (while files - ;;; (let ((current (nth 5 (file-attributes (car files))))) - ;;; (if (and initial (not (equal initial current))) - ;;; (setq initial (current-time) files nil) - ;;; (setq initial current)) - ;;; (setq files (cdr files)))) - ;;; (format-time-string "%Y%m%d%H%M.%S" initial))) - (format-time-string "%Y%m%d%H%M.%S" (current-time))) +;;; Change file attributes (defun dired-do-chxxx (attribute-name program op-symbol arg) - ;; Change file attributes (mode, group, owner, timestamp) of marked files and + ;; Change file attributes (group, owner, timestamp) of marked files and ;; refresh their file lines. ;; ATTRIBUTE-NAME is a string describing the attribute to the user. ;; PROGRAM is the program used to change the attribute. - ;; OP-SYMBOL is the type of operation (for use in dired-mark-pop-up). - ;; ARG describes which files to use, as in dired-get-marked-files. + ;; OP-SYMBOL is the type of operation (for use in `dired-mark-pop-up'). + ;; ARG describes which files to use, as in `dired-get-marked-files'. (let* ((files (dired-get-marked-files t arg)) + (initial + (if (eq op-symbol 'touch) + (format-time-string "%Y%m%d%H%M.%S"))) + (default + (if (eq op-symbol 'touch) + (and (stringp (car files)) + (format-time-string "%Y%m%d%H%M.%S" + (nth 5 (file-attributes (car files))))))) (new-attribute (dired-mark-read-string (concat "Change " attribute-name " of %s to: ") - (if (eq op-symbol 'touch) (dired-touch-initial files)) - op-symbol arg files)) + initial op-symbol arg files default)) (operation (concat program " " new-attribute)) failures) (setq failures ------------------------------------------------------------ revno: 105356 committer: Chong Yidong branch nick: trunk timestamp: Fri 2011-07-29 22:11:31 -0400 message: Fix require statement in semantic/grammar.el. * lisp/semantic/grammar.el (semantic-grammar-insert-defanalyzers): Fix require. diff: === modified file 'etc/ChangeLog' --- etc/ChangeLog 2011-07-28 20:23:19 +0000 +++ etc/ChangeLog 2011-07-30 02:11:31 +0000 @@ -1,3 +1,7 @@ +2011-07-30 Chong Yidong + + * grammars: New directory. + 2011-07-28 Andreas Schwab * NEWS: Document ## and #:. === modified file 'lisp/cedet/ChangeLog' --- lisp/cedet/ChangeLog 2011-07-04 15:36:38 +0000 +++ lisp/cedet/ChangeLog 2011-07-30 02:11:31 +0000 @@ -1,3 +1,8 @@ +2011-07-30 Chong Yidong + + * semantic/grammar.el (semantic-grammar-insert-defanalyzers): Fix + require. + 2011-07-04 Darren Hoo (tiny change) * semantic/db.el (semanticdb-file-table-object): Don't bug out on === modified file 'lisp/cedet/semantic/grammar.el' --- lisp/cedet/semantic/grammar.el 2011-01-25 04:08:28 +0000 +++ lisp/cedet/semantic/grammar.el 2011-07-30 02:11:31 +0000 @@ -801,7 +801,7 @@ (with-current-buffer semantic--grammar-input-buffer (setq tokens (semantic-grammar-tokens) props (semantic-grammar-token-properties tokens))) - (insert "(require 'semantic-lex)\n\n") + (insert "(require 'semantic/lex)\n\n") (let ((semantic-lex-types-obarray (semantic-lex-make-type-table tokens props)) semantic-grammar--lex-block-specs) ------------------------------------------------------------ revno: 105355 committer: Chong Yidong branch nick: trunk timestamp: Fri 2011-07-29 22:06:43 -0400 message: Add Semantic grammar files to etc/grammars diff: === added directory 'etc/grammars' === added file 'etc/grammars/README' --- etc/grammars/README 1970-01-01 00:00:00 +0000 +++ etc/grammars/README 2011-07-30 02:06:43 +0000 @@ -0,0 +1,18 @@ +This directory contains grammar files in Bison and Wisent, used to +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 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 + +Currently, the parser files in lisp/ are not generated directly from +these grammar files when making Emacs. This state of affairs, and the +contents of this directory, will change in a future version of Emacs. === added file 'etc/grammars/bovine-grammar.el' --- etc/grammars/bovine-grammar.el 1970-01-01 00:00:00 +0000 +++ etc/grammars/bovine-grammar.el 2011-07-30 02:06:43 +0000 @@ -0,0 +1,439 @@ +;;; bovine-grammar.el --- Bovine's input grammar mode +;; +;; Copyright (C) 2002-2011 Free Software Foundation, Inc. +;; +;; Author: David Ponce +;; Maintainer: David Ponce +;; Created: 26 Aug 2002 +;; Keywords: syntax + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: +;; +;; Major mode for editing Bovine's input grammar (.by) files. + +;;; History: + +;;; Code: +(require 'semantic) +(require 'semantic/grammar) +(require 'semantic/find) + +(defun bovine-grammar-EXPAND (bounds nonterm) + "Expand call to EXPAND grammar macro. +Return the form to parse from within a nonterminal between BOUNDS. +NONTERM is the nonterminal symbol to start with." + `(semantic-bovinate-from-nonterminal + (car ,bounds) (cdr ,bounds) ',nonterm)) + +(defun bovine-grammar-EXPANDFULL (bounds nonterm) + "Expand call to EXPANDFULL grammar macro. +Return the form to recursively parse the area between BOUNDS. +NONTERM is the nonterminal symbol to start with." + `(semantic-parse-region + (car ,bounds) (cdr ,bounds) ',nonterm 1)) + +(defun bovine-grammar-TAG (name class &rest attributes) + "Expand call to TAG grammar macro. +Return the form to create a generic semantic tag. +See the function `semantic-tag' for the meaning of arguments NAME, +CLASS and ATTRIBUTES." + `(semantic-tag ,name ,class ,@attributes)) + +(defun bovine-grammar-VARIABLE-TAG (name type default-value &rest attributes) + "Expand call to VARIABLE-TAG grammar macro. +Return the form to create a semantic tag of class variable. +See the function `semantic-tag-new-variable' for the meaning of +arguments NAME, TYPE, DEFAULT-VALUE and ATTRIBUTES." + `(semantic-tag-new-variable ,name ,type ,default-value ,@attributes)) + +(defun bovine-grammar-FUNCTION-TAG (name type arg-list &rest attributes) + "Expand call to FUNCTION-TAG grammar macro. +Return the form to create a semantic tag of class function. +See the function `semantic-tag-new-function' for the meaning of +arguments NAME, TYPE, ARG-LIST and ATTRIBUTES." + `(semantic-tag-new-function ,name ,type ,arg-list ,@attributes)) + +(defun bovine-grammar-TYPE-TAG (name type members parents &rest attributes) + "Expand call to TYPE-TAG grammar macro. +Return the form to create a semantic tag of class type. +See the function `semantic-tag-new-type' for the meaning of arguments +NAME, TYPE, MEMBERS, PARENTS and ATTRIBUTES." + `(semantic-tag-new-type ,name ,type ,members ,parents ,@attributes)) + +(defun bovine-grammar-INCLUDE-TAG (name system-flag &rest attributes) + "Expand call to INCLUDE-TAG grammar macro. +Return the form to create a semantic tag of class include. +See the function `semantic-tag-new-include' for the meaning of +arguments NAME, SYSTEM-FLAG and ATTRIBUTES." + `(semantic-tag-new-include ,name ,system-flag ,@attributes)) + +(defun bovine-grammar-PACKAGE-TAG (name detail &rest attributes) + "Expand call to PACKAGE-TAG grammar macro. +Return the form to create a semantic tag of class package. +See the function `semantic-tag-new-package' for the meaning of +arguments NAME, DETAIL and ATTRIBUTES." + `(semantic-tag-new-package ,name ,detail ,@attributes)) + +(defun bovine-grammar-CODE-TAG (name detail &rest attributes) + "Expand call to CODE-TAG grammar macro. +Return the form to create a semantic tag of class code. +See the function `semantic-tag-new-code' for the meaning of arguments +NAME, DETAIL and ATTRIBUTES." + `(semantic-tag-new-code ,name ,detail ,@attributes)) + +(defun bovine-grammar-ALIAS-TAG (name aliasclass definition &rest attributes) + "Expand call to ALIAS-TAG grammar macro. +Return the form to create a semantic tag of class alias. +See the function `semantic-tag-new-alias' for the meaning of arguments +NAME, ALIASCLASS, DEFINITION and ATTRIBUTES." + `(semantic-tag-new-alias ,name ,aliasclass ,definition ,@attributes)) + +;; Cache of macro definitions currently in use. +(defvar bovine--grammar-macros nil) + +(defun bovine-grammar-expand-form (form quotemode &optional inplace) + "Expand FORM into a new one suitable to the bovine parser. +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 + ((and (= (length form) 1) (listp (car form))) + (insert "\n(append") + (bovine-grammar-expand-form (car form) quotemode nil) + (insert ")") + (setq form nil inplace nil) + ) + ((and (= (length form) 1) (symbolp (car form))) + (insert "\n'" (symbol-name (car form))) + (setq form nil inplace nil) + ) + (t + (insert "\n(list") + (setq inplace t) + ))) + (let ((macro (assq (car form) bovine--grammar-macros)) + inlist first n q x) + (if macro + (bovine-grammar-expand-form + (apply (cdr macro) (cdr form)) + quotemode t) + (if inplace (insert "\n(")) + (while form + (setq first (car form) + form (cdr form)) + (cond + ((eq first nil) + (when (and (not inlist) (not inplace)) + (insert "\n(list") + (setq inlist t)) + (insert " nil") + ) + ((listp first) + ;;(let ((fn (and (symbolp (caar form)) (fboundp (caar form))))) + (when (and (not inlist) (not inplace)) + (insert "\n(list") + (setq inlist t)) + ;;(if (and inplace (not fn) (not (eq (caar form) 'EXPAND))) + ;; (insert " (append")) + (bovine-grammar-expand-form + first quotemode t) ;;(and fn (not (eq fn 'quote)))) + ;;(if (and inplace (not fn) (not (eq (caar form) 'EXPAND))) + ;; (insert ")")) + ;;) + ) + ((symbolp first) + (setq n (symbol-name first) ;the name + q quotemode ;implied quote flag + x nil) ;expand flag + (if (eq (aref n 0) ?,) + (if quotemode + ;; backquote mode needs the @ + (if (eq (aref n 1) ?@) + (setq n (substring n 2) + q nil + x t) + ;; non backquote mode behaves normally. + (setq n (substring n 1) + q nil)) + (setq n (substring n 1) + x t))) + (if (string= n "") + (progn + ;; We expand only the next item in place (a list?) + ;; A regular inline-list... + (bovine-grammar-expand-form (car form) quotemode t) + (setq form (cdr form))) + (if (and (eq (aref n 0) ?$) + ;; Don't expand $ tokens in implied quote mode. + ;; This acts like quoting in other symbols. + (not q)) + (progn + (cond + ((and (not x) (not inlist) (not inplace)) + (insert "\n(list")) + ((and x inlist (not inplace)) + (insert ")") + (setq inlist nil))) + (insert "\n(nth " (int-to-string + (1- (string-to-number + (substring n 1)))) + " vals)") + (and (not x) (not inplace) + (setq inlist t))) + + (when (and (not inlist) (not inplace)) + (insert "\n(list") + (setq inlist t)) + (or (char-equal (char-before) ?\() + (insert " ")) + (insert (if (or inplace (eq first t)) + "" "'") + n))) ;; " " + ) + (t + (when (and (not inlist) (not inplace)) + (insert "\n(list") + (setq inlist t)) + (insert (format "\n%S" first)) + ) + )) + (if inlist (insert ")")) + (if inplace (insert ")"))) + ))) + +(defun bovine-grammar-expand-action (textform quotemode) + "Expand semantic action string TEXTFORM into Lisp code. +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. + (insert "\n") + (cond + ((eq (car sexp) 'EXPAND) + (insert ",(lambda (vals start end)") + ;; The EXPAND macro definition is mandatory + (bovine-grammar-expand-form + (apply (cdr (assq 'EXPAND bovine--grammar-macros)) (cdr sexp)) + quotemode t) + ) + ((and (listp (car sexp)) (eq (caar sexp) 'EVAL)) + ;; The user wants to evaluate the following args. + ;; Use a simpler expander + ) + (t + (insert ",(semantic-lambda") + (bovine-grammar-expand-form sexp quotemode) + )) + (insert ")\n"))) +) + +(defun bovine-grammar-parsetable-builder () + "Return the parser table expression as a string value. +The format of a bovine parser table is: + + ( ( NONTERMINAL-SYMBOL1 MATCH-LIST1 ) + ( NONTERMINAL-SYMBOL2 MATCH-LIST2 ) + ... + ( NONTERMINAL-SYMBOLn MATCH-LISTn ) + +Where each NONTERMINAL-SYMBOL is an artificial symbol which can appear +in any child state. As a starting place, one of the NONTERMINAL-SYMBOLS +must be `bovine-toplevel'. + +A MATCH-LIST is a list of possible matches of the form: + + ( STATE-LIST1 + STATE-LIST2 + ... + STATE-LISTN ) + +where STATE-LIST is of the form: + ( TYPE1 [ \"VALUE1\" ] TYPE2 [ \"VALUE2\" ] ... LAMBDA ) + +where TYPE is one of the returned types of the token stream. +VALUE is a value, or range of values to match against. For +example, a SYMBOL might need to match \"foo\". Some TYPES will not +have matching criteria. + +LAMBDA is a lambda expression which is evaled with the text of the +type when it is found. It is passed the list of all buffer text +elements found since the last lambda expression. It should return a +semantic element (see below.) + +For consistency between languages, try to use common return values +from your parser. Please reference the chapter \"Writing Parsers\" in +the \"Language Support Developer's Guide -\" in the semantic texinfo +manual." + (let* ((start (semantic-grammar-start)) + (scopestart (semantic-grammar-scopestart)) + (quotemode (semantic-grammar-quotemode)) + (tags (semantic-find-tags-by-class + 'token (current-buffer))) + (nterms (semantic-find-tags-by-class + 'nonterminal (current-buffer))) + ;; Setup the cache of macro definitions. + (bovine--grammar-macros (semantic-grammar-macros)) + nterm rules items item actn prec tag type regex) + + ;; Check some trivial things + (cond + ((null nterms) + (error "Bad input grammar")) + (start + (if (cdr start) + (message "Extra start symbols %S ignored" (cdr start))) + (setq start (symbol-name (car start))) + (unless (semantic-find-first-tag-by-name start nterms) + (error "start symbol `%s' has no rule" start))) + (t + ;; Default to the first grammar rule. + (setq start (semantic-tag-name (car nterms))))) + (when scopestart + (setq scopestart (symbol-name scopestart)) + (unless (semantic-find-first-tag-by-name scopestart nterms) + (error "scopestart symbol `%s' has no rule" scopestart))) + + ;; Generate the grammar Lisp form. + (with-temp-buffer + (erase-buffer) + (insert "`(") + ;; Insert the start/scopestart rules + (insert "\n(bovine-toplevel \n(" + start + ")\n) ;; end bovine-toplevel\n") + (when scopestart + (insert "\n(bovine-inner-scope \n(" + scopestart + ")\n) ;; end bovine-inner-scope\n")) + ;; Process each nonterminal + (while nterms + (setq nterm (car nterms) + ;; We can't use the override form because the current buffer + ;; is not the originator of the tag. + rules (semantic-tag-components-semantic-grammar-mode nterm) + nterm (semantic-tag-name nterm) + nterms (cdr nterms)) + (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) + prec (semantic-tag-get-attribute (car rules) :prec) + actn (semantic-tag-get-attribute (car rules) :expr) + rules (cdr rules)) + ;; Process each item + (insert "\n(") + (if (null items) + ;; EMPTY rule + (insert ";;EMPTY" (if actn "" "\n")) + ;; Expand items + (while items + (setq item (car items) + items (cdr items)) + (if (consp item) ;; mid-rule action + (message "Mid-rule action %S ignored" item) + (or (char-equal (char-before) ?\() + (insert "\n")) + (cond + ((member item '("bovine-toplevel" "bovine-inner-scope")) + (error "`%s' is a reserved internal name" item)) + ;; Replace ITEM by its %token definition. + ;; If a '%token TYPE ITEM [REGEX]' definition exists + ;; in the grammar, ITEM is replaced by TYPE [REGEX]. + ((setq tag (semantic-find-first-tag-by-name + item tags) + type (semantic-tag-get-attribute tag :type)) + (insert type) + (if (setq regex (semantic-tag-get-attribute tag :value)) + (insert (format "\n%S" regex)))) + ;; Don't change ITEM + (t + (insert (semantic-grammar-item-text item))) + )))) + + (if prec + (message "%%prec %S ignored" prec)) + (if actn + (bovine-grammar-expand-action actn quotemode)) + (insert ")")) + (insert "\n) ;; end " nterm "\n")) + (insert ")\n") + (buffer-string)))) + +(defun bovine-grammar-setupcode-builder () + "Return the text of the setup code." + (format + "(setq semantic--parse-table %s\n\ + semantic-debug-parser-source %S\n\ + semantic-debug-parser-class 'semantic-bovine-debug-parser + semantic-flex-keywords-obarray %s\n\ + %s)" + (semantic-grammar-parsetable) + (buffer-name) + (semantic-grammar-keywordtable) + (let ((mode (semantic-grammar-languagemode))) + ;; Is there more than one major mode? + (if (and (listp mode) (> (length mode) 1)) + (format "semantic-equivalent-major-modes '%S\n" mode) + "")))) + +(defvar bovine-grammar-menu + '("BY Grammar" + ) + "BY mode specific grammar menu. +Menu items are appended to the common grammar menu.") + +(define-derived-mode bovine-grammar-mode semantic-grammar-mode "BY" + "Major mode for editing Bovine grammars." + (semantic-grammar-setup-menu bovine-grammar-menu) + (semantic-install-function-overrides + '((grammar-parsetable-builder . bovine-grammar-parsetable-builder) + (grammar-setupcode-builder . bovine-grammar-setupcode-builder) + ))) + +(add-to-list 'auto-mode-alist '("\\.by$" . bovine-grammar-mode)) + +(defvar-mode-local bovine-grammar-mode semantic-grammar-macros + '( + (ASSOC . semantic-grammar-ASSOC) + (EXPAND . bovine-grammar-EXPAND) + (EXPANDFULL . bovine-grammar-EXPANDFULL) + (TAG . bovine-grammar-TAG) + (VARIABLE-TAG . bovine-grammar-VARIABLE-TAG) + (FUNCTION-TAG . bovine-grammar-FUNCTION-TAG) + (TYPE-TAG . bovine-grammar-TYPE-TAG) + (INCLUDE-TAG . bovine-grammar-INCLUDE-TAG) + (PACKAGE-TAG . bovine-grammar-PACKAGE-TAG) + (CODE-TAG . bovine-grammar-CODE-TAG) + (ALIAS-TAG . bovine-grammar-ALIAS-TAG) + ) + "Semantic grammar macros used in bovine grammars.") + +(provide 'semantic/bovine/grammar) + +;;; semantic/bovine/grammar.el ends here === added file 'etc/grammars/c.by' --- etc/grammars/c.by 1970-01-01 00:00:00 +0000 +++ etc/grammars/c.by 2011-07-30 02:06:43 +0000 @@ -0,0 +1,1205 @@ +;;; semantic/bovine/c.by -- LL grammar for C/C++ language specification +;; +;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Eric M. Ludlam +;; Copyright (C) 2002, 2003 David Ponce +;; +;; Author: Eric M. Ludlam +;; David Ponce +;; Klaus Berndl +;; +;; +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; This software is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. +;; + +;; TODO: From Nate Schley +;; > * Can't parse signature element: "const char* const rmc_ClrTxt" +;; > * Can't parse signature element: "char* const dellog_ClrTxt" +;; > * Can't parse signature element: "const char* dellog_SetTxt" +;; > * Can't parse signature element: "const RmcCmdSSPADetailedStatus& status" +;; > +;; > And FWIW I have seen the following argument cases not handled, even +;; > with no leading/trailing spaces in the split: +;; > +;; > * Can't parse signature element: "const bool currentAlarmStatus" +;; > * Can't parse signature element: "unsigned char mode" +;; > * Can't parse signature element: "TskTimingTask* tsktimingtask" +;; > * Can't parse signature element: "unsigned char htrStatus" +;; > * Can't parse signature element: "char trackPower[]" +;; > * Can't parse signature element: "const RmcCmdMCDetailedStatus& status" +;; > * Can't parse signature element: "RmcBucStatus* rftBucStatus" + +%package c-by + +%languagemode c-mode c++-mode +%start declaration +%scopestart codeblock + +%token HASH "\\`[#]\\'" +%token PERIOD "\\`[.]\\'" +%token COLON "\\`[:]\\'" +%token SEMICOLON "\\`[;]\\'" +%token STAR "\\`[*]\\'" +%token AMPERSAND "\\`[&]\\'" +%token DIVIDE "\\`[/]\\'" +%token PLUS "\\`[+]\\'" +%token MINUS "\\`[-]\\'" +%token BANG "\\`[!]\\'" +%token EQUAL "\\`[=]\\'" +%token LESS "\\`[<]\\'" +%token GREATER "\\`[>]\\'" +%token COMA "\\`[,]\\'" +%token TILDE "\\`[~]\\'" +%token MOD "\\`[%]\\'" +%token HAT "\\`\\^\\'" +%token OR "\\`[|]\\'" +%token C "\"C\"" +%token CPP "\"C\\+\\+\"" +%token ZERO "^0$" +%token RESTRICT "\\<\\(__\\)?restrict\\>" +%token LPAREN "(" +%token RPAREN ")" +%token LBRACE "{" +%token RBRACE "}" +%token BRACK_BLCK "\\[.*\\]$" +%token PAREN_BLCK "^(" +%token BRACE_BLCK "^{" +%token VOID_BLCK "^(void)$" +%token PARENS "()" +%token BRACKETS "\\[\\]" + +%token EXTERN "extern" +%put EXTERN summary "Declaration Modifier: extern ..." +%token STATIC "static" +%put STATIC summary "Declaration Modifier: static ..." +%token CONST "const" +%put CONST summary "Declaration Modifier: const ..." +%token VOLATILE "volatile" +%put VOLATILE summary "Declaration Modifier: volatile ..." +%token REGISTER "register" +%put REGISTER summary "Declaration Modifier: register ..." +%token SIGNED "signed" +%put SIGNED summary "Numeric Type Modifier: signed ..." +%token UNSIGNED "unsigned" +%put UNSIGNED summary "Numeric Type Modifier: unsigned ..." + +%token INLINE "inline" +%put INLINE summary "Function Modifier: inline (...) {...};" +%token VIRTUAL "virtual" +%put VIRTUAL summary "Method Modifier: virtual (...) ..." +%token MUTABLE "mutable" +%put MUTABLE summary "Member Declaration Modifier: mutable ..." + +%token STRUCT "struct" +%put STRUCT summary "Structure Type Declaration: struct [name] { ... };" +%token UNION "union" +%put UNION summary "Union Type Declaration: union [name] { ... };" +%token ENUM "enum" +%put ENUM summary "Enumeration Type Declaration: enum [name] { ... };" +%token TYPEDEF "typedef" +%put TYPEDEF summary "Arbitrary Type Declaration: typedef ;" +%token CLASS "class" +%put CLASS summary "Class Declaration: class [:parents] { ... };" +%token TYPENAME "typename" +%put TYPENAME summary "typename is used to handle a qualified name as a typename;" +%token NAMESPACE "namespace" +%put NAMESPACE summary "Namespace Declaration: namespace { ... };" +%token USING "using" +%put USING summary "using ;" + +%token NEW "new" +%put NEW summary "new ();" +%token DELETE "delete" +%put DELETE summary "delete ;" + +;; Despite this, this parser can find templates by ignoring the TEMPLATE +;; keyword, and finding the class/method being templateized. +%token TEMPLATE "template" +%put TEMPLATE summary "template TYPE_OR_FUNCTION" + +%token THROW "throw" +%put THROW summary " () throw () ..." +%token REENTRANT "reentrant" +%put REENTRANT summary " () reentrant ..." +%token TRY "try" +%token CATCH "catch" +%put { TRY CATCH } summary "try { } catch { }" + +;; Leave these alone for now. +%token OPERATOR "operator" +%token PUBLIC "public" +%token PRIVATE "private" +%token PROTECTED "protected" +%token FRIEND "friend" +%put FRIEND summary "friend class " + +;; These aren't used for parsing, but is a useful place to describe the keywords. +%token IF "if" +%token ELSE "else" +%put {IF ELSE} summary "if () { code } [ else { code } ]" + +%token DO "do" +%token WHILE "while" +%put DO summary " do { code } while ();" +%put WHILE summary "do { code } while (); or while () { code };" + +%token FOR "for" +%put FOR summary "for(; ; ) { code }" + +%token SWITCH "switch" +%token CASE "case" +%token DEFAULT "default" +%put {SWITCH CASE DEFAULT} summary +"switch () { case : code; ... default: code; }" + +%token RETURN "return" +%put RETURN summary "return ;" + +%token BREAK "break" +%put BREAK summary "Non-local exit within a loop or switch (for, do/while, switch): break;" +%token CONTINUE "continue" +%put CONTINUE summary "Non-local continue within a loop (for, do/while): continue;" + +%token SIZEOF "sizeof" +%put SIZEOF summary "Compile time macro: sizeof() // size in bytes" + +;; Types +%token VOID "void" +%put VOID summary "Built in typeless type: void" +%token CHAR "char" +%put CHAR summary "Integral Character Type: (0 to 256)" +%token WCHAR "wchar_t" +%put WCHAR summary "Wide Character Type" +%token SHORT "short" +%put SHORT summary "Integral Primitive Type: (-32768 to 32767)" +%token INT "int" +%put INT summary "Integral Primitive Type: (-2147483648 to 2147483647)" +%token LONG "long" +%put LONG summary "Integral primitive type (-9223372036854775808 to 9223372036854775807)" +%token FLOAT "float" +%put FLOAT summary "Primitive floating-point type (single-precision 32-bit IEEE 754)" +%token DOUBLE "double" +%put DOUBLE summary "Primitive floating-point type (double-precision 64-bit IEEE 754)" +%token BOOL "bool" +%put BOOL summary "Primitive boolean type" + +%token UNDERP "_P" +%token UNDERUNDERP "__P" +%put UNDERP summary "Common macro to eliminate prototype compatibility on some compilers" +%put UNDERUNDERP summary "Common macro to eliminate prototype compatibility on some compilers" + +%% + +declaration + : macro + | type + ;; TODO: Klaus Berndl: Is the define here necessary or even wrong? + ;; Is this part not already covered by macro?? + | define + | var-or-fun + | extern-c + | template + | using + ; + +codeblock + : define + | codeblock-var-or-fun + | type ;; type is less likely to be used here. + | using + ; + +extern-c-contents + : open-paren + ( nil ) + | declaration + | close-paren + ( nil ) + ; + +extern-c + : EXTERN C semantic-list + ;; Extern C commands which contain a list need to have the + ;; entries of the list extracted, and spliced into the main + ;; list of entries. This must be done via the function + ;; that expands singular nonterminals, such as int x,y; + (TAG "C" 'extern :members (EXPANDFULL $3 extern-c-contents) ) + | EXTERN CPP semantic-list + (TAG "C" 'extern :members (EXPANDFULL $3 extern-c-contents) ) + | EXTERN C + ;; A plain extern "C" call should add something to the token, + ;; but just strip it from the buffer here for now. + ( nil ) + | EXTERN CPP + ( nil ) + ; + +macro + : spp-macro-def + (VARIABLE-TAG $1 nil nil :constant-flag t ) + | spp-system-include + (INCLUDE-TAG $1 t) + | spp-include + (INCLUDE-TAG $1 nil) + ; + +;; This is used in struct parts. +define + : spp-macro-def + (VARIABLE-TAG $1 nil nil :constant-flag t) + | spp-macro-undef + ( nil ) + ; + +;; In C++, structures can have the same things as classes. +;; So delete this somday in the figure. +;; +;;structparts : semantic-list +;; (EXPANDFULL $1 structsubparts) +;; ; +;; +;;structsubparts : LBRACE +;; ( nil ) +;; | RBRACE +;; ( nil ) +;; | var-or-fun +;; | define +;; ;; sometimes there are defines in structs. +;; ; + +unionparts + : semantic-list + (EXPANDFULL $1 classsubparts) + ; + +opt-symbol + : symbol + | ;;EMPTY + ; + +;; @todo - support 'friend' construct. +classsubparts + : LBRACE + ( nil ) + | RBRACE + ( nil ) + | class-protection opt-symbol COLON + ;; For QT, they may put a `slot' keyword between the protection + ;; and the COLON. @todo - Have the QT stuff use macros. + (TAG (car $1) 'label) + | var-or-fun + | FRIEND func-decl + (TAG (car $2) 'friend) + | FRIEND CLASS symbol + (TAG $3 'friend) + | type + | define + | template + | ;;EMPTY + ; + +opt-class-parents + : COLON class-parents opt-template-specifier + ( $2 ) + | ;;EMPTY + ( ) + ; + +one-class-parent + : opt-class-protection opt-class-declmods namespace-symbol + (TYPE-TAG (car $3) "class" nil nil :protection (car $1)) + | opt-class-declmods opt-class-protection namespace-symbol + (TYPE-TAG (car $3) "class" nil nil :protection (car $2)) + ; + +class-parents + : one-class-parent COMA class-parents + ( ,(cons ,$1 $3 ) ) + | one-class-parent + ( $1 ) + ; + +opt-class-declmods + : class-declmods opt-class-declmods + ( nil ) + | ;;EMPTY + ; + +class-declmods + : VIRTUAL + ; + +class-protection + : PUBLIC + | PRIVATE + | PROTECTED + ; + +opt-class-protection + : class-protection + ( ,$1 ) + | ;;EMPTY - Same as private + ( "unspecified" ) + ; + +namespaceparts + : semantic-list + (EXPANDFULL $1 namespacesubparts) + ; + +namespacesubparts + : LBRACE + ( nil ) + | RBRACE + ( nil ) + | type + | var-or-fun + | define + | class-protection COLON + (TAG (car $1) 'label) + ;; In C++, this label in a classsubpart represents + ;; PUBLIC or PRIVATE bits. Ignore them for now. + | template + | using + | ;;EMPTY + ; + +enumparts + : semantic-list + (EXPANDFULL $1 enumsubparts) + ; + +enumsubparts + : symbol opt-assign + (VARIABLE-TAG $1 "int" (car $2) :constant-flag t ) + | LBRACE + ( nil ) + | RBRACE + ( nil ) + | COMA + ( nil ) + ; + +opt-name + : symbol + | ;;EMPTY + ( "" ) + ; + +typesimple + : struct-or-class opt-class opt-name opt-template-specifier + opt-class-parents semantic-list + (TYPE-TAG (car $3) (car $1) + (let ((semantic-c-classname (cons (car ,$3) (car ,$1)))) + (EXPANDFULL $6 classsubparts)) + $5 + :template-specifier $4 + :parent (car ,$2)) + | struct-or-class opt-class opt-name opt-template-specifier + opt-class-parents + (TYPE-TAG (car $3) (car $1) nil $5 + :template-specifier $4 + :prototype t + :parent (car ,$2)) + | UNION opt-class opt-name unionparts + (TYPE-TAG (car $3) $1 $4 nil + :parent (car ,$2)) + | ENUM opt-class opt-name enumparts + (TYPE-TAG (car $3) $1 $4 nil + :parent (car ,$2)) + ;; Klaus Berndl: a typedef can be a typeformbase with all this + ;; declmods stuff. + | TYPEDEF declmods typeformbase cv-declmods typedef-symbol-list + ;;;; We put the type this typedef renames into PARENT + ;;;; but will move it in the expand function. + (TYPE-TAG $5 $1 nil (list $3) ) + ; + +typedef-symbol-list + : typedefname COMA typedef-symbol-list + ( ,(cons $1 $3) ) + | typedefname + ( $1 ) + ; + +;; TODO: Klaus Berndl: symbol -> namespace-symbol?! Answer: Probably +;; symbol is correct here! +typedefname + : opt-stars symbol opt-bits opt-array + ( $1 $2 ) + ; + +struct-or-class + : STRUCT + | CLASS + ; + +type + : typesimple SEMICOLON + ( ,$1 ) + ;; named namespaces like "namespace XXX {" + | NAMESPACE symbol namespaceparts + (TYPE-TAG $2 $1 $3 nil ) + ;; unnamed namespaces like "namespace {" + | NAMESPACE namespaceparts + (TYPE-TAG "unnamed" $1 $2 nil ) + ;; David Engster: namespace alias like "namespace foo = bar;" + | NAMESPACE symbol EQUAL typeformbase SEMICOLON + (TYPE-TAG $2 $1 (list (TYPE-TAG (car $4) $1 nil nil)) nil :kind 'alias ) + ; + +;; Klaus Berndl: We must parse "using namespace XXX" too + +;; Using is vaguely like an include statement in the named portions +;; of the code. We should probably specify a new token type for this. + +using + : USING usingname SEMICOLON + (TAG (car $2) 'using :type ,$2 ) + ; + +;; Jan Moringen: Differentiate between 'using' and 'using namespace' +;; Adapted to creating type tags by EML. +usingname + : typeformbase + (TYPE-TAG (car $1) "class" nil nil :prototype t) + | NAMESPACE typeformbase + (TYPE-TAG (car $2) "namespace" nil nil :prototype t) + ; + +template + : TEMPLATE template-specifier opt-friend template-definition + ( ,(semantic-c-reconstitute-template $4 ,$2) ) + ; + +opt-friend + : FRIEND + | ;;EMPTY + ; + +opt-template-specifier + : template-specifier + ( ,$1 ) + | ;;EMPTY + ( ) + ; + +template-specifier + : LESS template-specifier-types GREATER + ( ,$2 ) + ; + +template-specifier-types + : template-var template-specifier-type-list + ( ,(cons ,$1 ,$2 ) ) + | ;;EMPTY + ; + +template-specifier-type-list + : COMA template-specifier-types + ( ,$2 ) + | ;;EMPTY + ( ) + ; + +;; template-var +;; : template-type opt-stars opt-template-equal +;; ( ,(cons (concat (car $1) (make-string (car ,$2) ?*)) +;; (cdr $1))) +;; ;; Klaus Berndl: for template-types the template-var can also be +;; ;; literals or constants. Example: map +;; ;; map_size10_var; This parses also template which is +;; ;; nonsense but who cares.... +;; | string +;; ( $1 ) +;; | number +;; ( $1 ) +;; ; + +template-var + : + ;; Klaus Berndl: The following handles all template-vars of + ;; template-definitions + template-type opt-template-equal + ( ,(cons (car $1) (cdr $1)) ) + ;; Klaus Berndl: for template-types the template-var can also be + ;; literals or constants. + ;; Example: map map_size10_var; This parses also + ;; template which is nonsense but who cares.... + | string + ( $1 ) + | number + ( $1 ) + ;; Klaus Berndl: In template-types arguments can be any symbols with + ;; optional address-operator (&) and optional dereferencing operator + ;; (*). Example map sized_map_var. + | opt-stars opt-ref namespace-symbol + ( ,$3 ) + ;; Some code can compile down into a number, but starts out as an + ;; expression, such as "sizeof(a)", or (sizeof(a)/sizeof(b)) + | semantic-list + ( $1 ) + | SIZEOF semantic-list + ( $2 ) + ; + +opt-template-equal + : EQUAL symbol LESS template-specifier-types GREATER + ( $2 ) + | EQUAL symbol + ( $2 ) + | ;;EMPTY + ( ) + ; + +template-type + : CLASS symbol + (TYPE-TAG $2 "class" nil nil ) + | STRUCT symbol + (TYPE-TAG $2 "struct" nil nil ) + ;; TODO: Klaus Berndl: For the moment is is ok, that we parse the C++ + ;; keyword typename as a class.... + | TYPENAME symbol + (TYPE-TAG $2 "class" nil nil) + ;; Klaus Berndl: template-types can be all flavors of variable-args + ;; but here the argument is ignored, only the type stuff is needed. + | declmods typeformbase cv-declmods opt-stars + opt-ref variablearg-opt-name + (TYPE-TAG (car $2) nil nil nil + :constant-flag (if (member "const" (append $1 $3)) t nil) + :typemodifiers (delete "const" (append $1 $3)) + :reference (car ,$5) + :pointer (car $4) + ) + ; + +template-definition + : type + ( ,$1 ) + | var-or-fun + ( ,$1 ) + ; + +opt-stars + : STAR opt-starmod opt-stars + ( (1+ (car $3)) ) + | ;;EMPTY + ( 0 ) + ; + +opt-starmod + : STARMOD opt-starmod + ( ,(cons (,car ,$1) $2) ) + | ;;EMPTY + () + ; + +STARMOD + : CONST + ; + +declmods + : DECLMOD declmods + ( ,(cons ,(car ,$1) $2 ) ) + | DECLMOD + ( ,$1 ) + | ;;EMPTY + () + ; + +DECLMOD + : EXTERN + | STATIC + | CVDECLMOD + ;; Klaus Berndl: IMHO signed and unsigned are not decl-modes but + ;; these are only valid for some buildin-types like short, int + ;; etc... whereas "real" declmods are valid for all types, buildin + ;; and user-defined! SIGNED UNSIGNED + | INLINE + | REGISTER + | FRIEND + ;; Klaus Berndl: There can be a few cases where TYPENAME is not + ;; allowed in C++-syntax but better than not recognizing the allowed + ;; situations. + | TYPENAME + | METADECLMOD + ;; This is a hack in case we are in a class. + | VIRTUAL + ; + +metadeclmod + : METADECLMOD + () + | ;;EMPTY + () + ; + +CVDECLMOD + : CONST + | VOLATILE + ; + +cv-declmods + : CVDECLMOD cv-declmods + ( ,(cons ,(car ,$1) $2 ) ) + | CVDECLMOD + ( ,$1 ) + | ;;EMPTY + () + ; + +METADECLMOD + : VIRTUAL + | MUTABLE + ; + +;; C++: A type can be modified into a reference by "&" +opt-ref + : AMPERSAND + ( 1 ) + | ;;EMPTY + ( 0 ) + ; + +typeformbase + : typesimple + ( ,$1 ) + | STRUCT symbol + (TYPE-TAG $2 $1 nil nil ) + | UNION symbol + (TYPE-TAG $2 $1 nil nil ) + | ENUM symbol + (TYPE-TAG $2 $1 nil nil ) + | builtintype + ( ,$1 ) + | symbol template-specifier + (TYPE-TAG $1 "class" nil nil :template-specifier $2) + ;;| namespace-symbol opt-stars opt-template-specifier + ;;| namespace-symbol opt-template-specifier + | namespace-symbol-for-typeformbase opt-template-specifier + (TYPE-TAG (car $1) "class" nil nil + :template-specifier $2) + | symbol + ( $1 ) + ; + +signedmod + : UNSIGNED + | SIGNED + ; + +;; Klaus Berndl: builtintype-types was builtintype +builtintype-types + : VOID + | CHAR + ;; Klaus Berndl: Added WCHAR + | WCHAR + | SHORT INT + ( (concat $1 " " $2) ) + | SHORT + | INT + | LONG INT + ( (concat $1 " " $2) ) + | FLOAT + | DOUBLE + | BOOL + | LONG DOUBLE + ( (concat $1 " " $2) ) + ;; TODO: Klaus Berndl: Is there a long long, i think so?! + | LONG LONG + ( (concat $1 " " $2) ) + | LONG + ; + +builtintype + : signedmod builtintype-types + ( (concat (car $1) " " (car $2)) ) + | builtintype-types + ( ,$1 ) + ;; Klaus Berndl: unsigned is synonym for unsigned int and signed for + ;; signed int. To make this confusing stuff clear we add here the + ;; int. + | signedmod + ( (concat (car $1) " int") ) + ; + +;; Klaus Berndl: This parses also nonsense like "const volatile int +;; const volatile const const volatile a ..." but IMHO nobody writes +;; such code. Normaly we shoud define a rule like typeformbase-mode +;; which exactly defines the different allowed cases and combinations +;; of declmods (minus the CVDECLMOD) typeformbase and cv-declmods so +;; we could recognize more invalid code but IMHO this is not worth the +;; effort... +codeblock-var-or-fun + : declmods typeformbase declmods + opt-ref var-or-func-decl + ( ,(semantic-c-reconstitute-token ,$5 $1 $2 ) ) + ; + +var-or-fun + : codeblock-var-or-fun + ( ,$1 ) + ;; it is possible for a function to not have a type, and + ;; it is then assumed to be an int. How annoying. + ;; In C++, this could be a constructor or a destructor. + ;; Even more annoying. Only ever do this for regular + ;; top-level items. Ignore this problem in code blocks + ;; so that we don't have to deal with regular code + ;; being erroneously converted into types. + | declmods var-or-func-decl + ( ,(semantic-c-reconstitute-token ,$2 $1 nil ) ) + ; + +var-or-func-decl + : func-decl + ( ,$1 ) + | var-decl + ( ,$1 ) + ; + +func-decl + : opt-stars opt-class opt-destructor functionname + opt-template-specifier + opt-under-p + arg-list + opt-post-fcn-modifiers + opt-throw + opt-initializers + fun-or-proto-end + ( ,$4 'function + ;; Extra stuff goes in here. + ;; Continue with the stuff we found in + ;; this definition + $2 $3 $7 $9 $8 ,$1 ,$11 $5 ,$10) + | opt-stars opt-class opt-destructor functionname + opt-template-specifier + opt-under-p + ;; arg-list - - ini this case, a try implies a fcn. + opt-post-fcn-modifiers + opt-throw + opt-initializers + fun-try-end + ( ,$4 'function + ;; Extra stuff goes in here. + ;; Continue with the stuff we found in + ;; this definition + $2 $3 nil $8 $7 ,$1 ,$10 $5 ,$9) + ; + +var-decl + : varnamelist SEMICOLON + ( $1 'variable ) + ; + +opt-under-p + : UNDERP + ( nil ) + | UNDERUNDERP + ( nil ) + | ;;EMPTY + ; + +;; Klaus Berndl: symbol -> namespace-symbol +opt-initializers + : COLON namespace-symbol semantic-list opt-initializers + | COMA namespace-symbol semantic-list opt-initializers + | ;;EMPTY + ; + +opt-post-fcn-modifiers + : post-fcn-modifiers opt-post-fcn-modifiers + ( ,(cons ,$1 $2) ) + | ;;EMPTY + ( nil ) + ; + +post-fcn-modifiers + : REENTRANT + | CONST + ; + +opt-throw + : THROW semantic-list + ( EXPAND $2 throw-exception-list ) + | ;;EMPTY + ; + +;; Is this true? I don't actually know. +throw-exception-list + : namespace-symbol COMA throw-exception-list + ( ,(cons (car $1) $3) ) + | namespace-symbol RPAREN + ( ,$1 ) + | symbol RPAREN + ( $1 ) + | LPAREN throw-exception-list + ( ,$2 ) + | RPAREN + ( ) + ; + +opt-bits + : COLON number + ( $2 ) + | ;;EMPTY + ( nil ) + ; + +opt-array + : BRACK_BLCK opt-array + ;; Eventually we want to replace the 1 below with a size + ;; (if available) + ( (cons 1 (car ,$2) ) ) + | ;;EMPTY + ( nil ) + ; + +opt-assign + : EQUAL expression + ( $2 ) + | ;;EMPTY + ( nil ) + ; + +opt-restrict + : RESTRICT + | ;;EMPTY + ; + +;; Klaus Berndl: symbol -> namespace-symbol?! I think so. Can be that +;; then also some invalid C++-syntax is parsed but this is better than +;; not parsing valid syntax. +varname + : opt-stars opt-restrict namespace-symbol opt-bits opt-array + ( ,$3 ,$1 ,$4 ,$5 ) + ; + +;; I should store more in this def, but leave it simple for now. +;; Klaus Berndl: const and volatile can be written after the type! +variablearg + : declmods typeformbase cv-declmods opt-ref variablearg-opt-name + ( VARIABLE-TAG (list $5) $2 nil + :constant-flag (if (member "const" (append $1 $3)) t nil) + :typemodifiers (delete "const" (append $1 $3)) + :reference (car ,$4) + ) + ; + +variablearg-opt-name + : varname + ( ,$1 ) + ;; Klaus Berndl: This allows variableargs without a arg-name being + ;; parsed correct even if there several pointers (*) + | opt-stars + ( "" ,$1 nil nil nil ) + ; + +varname-opt-initializer + : semantic-list + | opt-assign + | ;; EMPTY + ; + +varnamelist + : opt-ref varname varname-opt-initializer COMA varnamelist + ( ,(cons $2 $5) ) + | opt-ref varname varname-opt-initializer + ( $2 ) + ; + +;; Klaus Berndl: Is necessary to parse stuff like +;; class list_of_facts : public list, public entity +;; and +;; list >::const_iterator l; +;; Parses also invalid(?) and senseless(?) c++-syntax like +;; symbol::symbol1::test_iterator +;; but better parsing too much than to less +namespace-symbol + : symbol opt-template-specifier COLON COLON namespace-symbol + ( (concat $1 "::" (car $5)) ) + | symbol opt-template-specifier + ( $1 ) + ; + +;; Don't pull an optional template specifier at the end of the +;; namespace symbol so that it can be picked up by the type. +namespace-symbol-for-typeformbase + : symbol opt-template-specifier COLON COLON namespace-symbol-for-typeformbase + ( (concat $1 "::" (car $5)) ) + | symbol + ( $1 ) + ; +;; namespace-symbol +;; : symbol COLON COLON namespace-symbol +;; ( (concat $1 "::" (car $4)) ) +;; | symbol +;; ( $1 ) +;; ; + +namespace-opt-class + : symbol COLON COLON namespace-opt-class + ( (concat $1 "::" (car $4)) ) + ;; Klaus Berndl: We must recognize template-specifiers here so we can + ;; parse correctly the method-implementations of template-classes + ;; outside the template-class-declaration Example: + ;; TemplateClass1::method_1(...) + | symbol opt-template-specifier COLON COLON + ( $1 ) + ; + +;; Klaus Berndl: The opt-class of a func-decl must be able to +;; recognize opt-classes with namespaces, e.g. +;; Test1::Test2::classname:: +opt-class + : namespace-opt-class + ( ,$1 ) + | ;;EMPTY + ( nil ) + ; + +opt-destructor + : TILDE + ( t ) + | ;;EMPTY + ( nil ) + ; + +arg-list + : PAREN_BLCK knr-arguments + ( ,$2 ) + | PAREN_BLCK + (EXPANDFULL $1 arg-sub-list) + | VOID_BLCK + ( ) + ; + +knr-varnamelist + : varname COMA knr-varnamelist + ( ,(cons $1 $3) ) + | varname + ( $1 ) + ; + + +knr-one-variable-decl + : declmods typeformbase cv-declmods knr-varnamelist + ( VARIABLE-TAG (nreverse $4) $2 nil + :constant-flag (if (member "const" (append $3)) t nil) + :typemodifiers (delete "const" $3) + ) + ; + +knr-arguments + : knr-one-variable-decl SEMICOLON knr-arguments + ( ,(append (semantic-expand-c-tag ,$1) ,$3) ) + | knr-one-variable-decl SEMICOLON + ( ,(semantic-expand-c-tag ,$1) ) + ; + +arg-sub-list + : variablearg + ( ,$1 ) + | PERIOD PERIOD PERIOD RPAREN + (VARIABLE-TAG "..." "vararg" nil) + | COMA + ( nil ) + | LPAREN + ( nil ) + | RPAREN + ( nil ) + ; + +operatorsym + : LESS LESS EQUAL + ( "<<=" ) + | GREATER GREATER EQUAL + ( ">>=" ) + | LESS LESS + ( "<<" ) + | GREATER GREATER + ( ">>" ) + | EQUAL EQUAL + ( "==" ) + | LESS EQUAL + ( "<=" ) + | GREATER EQUAL + ( ">=" ) + | BANG EQUAL + ( "!=" ) + | PLUS EQUAL + ( "+=" ) + | MINUS EQUAL + ( "-=" ) + | STAR EQUAL + ( "*=" ) + | DIVIDE EQUAL + ( "/=" ) + | MOD EQUAL + ( "%=" ) + | AMPERSAND EQUAL + ( "&=" ) + | OR EQUAL + ( "|=" ) + | MINUS GREATER STAR + ( "->*" ) + | MINUS GREATER + ( "->" ) + | PARENS + ( "()" ) + | BRACKETS + ( "[]" ) + | LESS + | GREATER + | STAR + | PLUS PLUS + ( "++" ) + | PLUS + | MINUS MINUS + ( "--" ) + | MINUS + | AMPERSAND AMPERSAND + ( "&&" ) + | AMPERSAND + | OR OR + ( "||" ) + | OR + | DIVIDE + | EQUAL + | BANG + | TILDE + | MOD + | COMA + ;; HAT EQUAL seems to have a really unpleasant result and + ;; breaks everything after it. Leave it at the end, though it + ;; doesn't seem to work. + | HAT EQUAL + ( "^=" ) + | HAT + ; + +functionname + : OPERATOR operatorsym + ( ,$2 ) + | semantic-list + ( EXPAND $1 function-pointer ) + | symbol + ( $1 ) + ; + +function-pointer + : LPAREN STAR symbol RPAREN + ( (concat "*" $3) ) + ; + +fun-or-proto-end + : SEMICOLON + ( t ) + | semantic-list + ( nil ) + ;; Here is an anoying feature of C++ pure virtual methods + | EQUAL ZERO SEMICOLON + ( :pure-virtual-flag ) + | fun-try-end + ( nil ) + ; + +fun-try-end + : TRY opt-initializers BRACE_BLCK fun-try-several-catches + ( nil ) + ; + +fun-try-several-catches + : CATCH PAREN_BLCK BRACE_BLCK fun-try-several-catches + ( ) + | CATCH BRACE_BLCK fun-try-several-catches + ( ) + | ;; EMPTY + ( ) + ; + +type-cast + : semantic-list + ( EXPAND $1 type-cast-list ) + ; + +type-cast-list + : open-paren typeformbase close-paren + ; + +opt-stuff-after-symbol + : PAREN_BLCK + | BRACK_BLCK + | ;; EMPTY + ; + +multi-stage-dereference + : namespace-symbol opt-stuff-after-symbol PERIOD multi-stage-dereference ;; method call + | namespace-symbol opt-stuff-after-symbol MINUS GREATER multi-stage-dereference ;;method call + | namespace-symbol opt-stuff-after-symbol + ; + +string-seq + : string string-seq + ( (concat $1 (car $2)) ) + | string + ( $1 ) + ; + +expr-start + : MINUS + | PLUS + | STAR + | AMPERSAND + ; + +expr-binop + : MINUS + | PLUS + | STAR + | DIVIDE + | AMPERSAND AMPERSAND + | AMPERSAND + | OR OR + | OR + ;; There are more. + ; + +;; Use expression for parsing only. Don't actually return anything +;; for now. Hopefully we can fix this later. +expression + : unaryexpression expr-binop unaryexpression + ( (identity start) (identity end) ) + | unaryexpression + ( (identity start) (identity end) ) + ; + +unaryexpression + : number + | multi-stage-dereference + | NEW multi-stage-dereference + | NEW builtintype-types semantic-list + ;; Klaus Berndl: symbol -> namespace-symbol! + | namespace-symbol + ;; Klaus Berndl: C/C++ allows sequences of strings which are + ;; concatenated by the precompiler to one string + | string-seq + | type-cast expression ;; A cast to some other type + ;; Casting the results of one expression to something else. + | semantic-list expression + | semantic-list + | expr-start expression + ; + +;;; semantic/bovine/c.by ends here === added file 'etc/grammars/java-tags.wy' --- etc/grammars/java-tags.wy 1970-01-01 00:00:00 +0000 +++ etc/grammars/java-tags.wy 2011-07-30 02:06:43 +0000 @@ -0,0 +1,753 @@ +;;; semantic/wisent/java-tags.wy -- Semantic LALR grammar for Java +;; +;; Copyright (C) 2002, 2007 David Ponce +;; Copyright (C) 2007 Eric Ludlam +;; +;; Author: David Ponce +;; Maintainer: David Ponce +;; Created: 25 Feb 2002 +;; Keywords: syntax +;; +;; This file is not part of GNU Emacs. +;; +;; This program is free software; you can redistribute it and/or +;; modify it under the terms of the GNU General Public License as +;; published by the Free Software Foundation; either version 2, or (at +;; your option) any later version. +;; +;; This software is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +%package java-tags-wy + +%languagemode java-mode + +;; The default start symbol +%start compilation_unit +;; Alternate entry points +;; - Needed by partial re-parse +%start package_declaration +%start import_declaration +%start class_declaration +%start field_declaration +%start method_declaration +%start formal_parameter +%start constructor_declaration +%start interface_declaration +;; - Needed by EXPANDFULL clauses +%start class_member_declaration +%start interface_member_declaration +%start formal_parameters + +;; ----------------------------- +;; Block & Parenthesis terminals +;; ----------------------------- +%type ;;syntax "\\s(\\|\\s)" matchdatatype block + +%token PAREN_BLOCK "(LPAREN RPAREN)" +%token BRACE_BLOCK "(LBRACE RBRACE)" +%token BRACK_BLOCK "(LBRACK RBRACK)" + +%token LPAREN "(" +%token RPAREN ")" +%token LBRACE "{" +%token RBRACE "}" +%token LBRACK "[" +%token RBRACK "]" + +;; ------------------ +;; Operator terminals +;; ------------------ +%type ;;syntax "\\(\\s.\\|\\s$\\|\\s'\\)+" matchdatatype string + +%token NOT "!" +%token NOTEQ "!=" +%token MOD "%" +%token MODEQ "%=" +%token AND "&" +%token ANDAND "&&" +%token ANDEQ "&=" +%token MULT "*" +%token MULTEQ "*=" +%token PLUS "+" +%token PLUSPLUS "++" +%token PLUSEQ "+=" +%token COMMA "," +%token MINUS "-" +%token MINUSMINUS "--" +%token MINUSEQ "-=" +%token DOT "." +%token DIV "/" +%token DIVEQ "/=" +%token COLON ":" +%token SEMICOLON ";" +%token LT "<" +%token LSHIFT "<<" +%token LSHIFTEQ "<<=" +%token LTEQ "<=" +%token EQ "=" +%token EQEQ "==" +%token GT ">" +%token GTEQ ">=" +%token RSHIFT ">>" +%token RSHIFTEQ ">>=" +%token URSHIFT ">>>" +%token URSHIFTEQ ">>>=" +%token QUESTION "?" +%token XOR "^" +%token XOREQ "^=" +%token OR "|" +%token OREQ "|=" +%token OROR "||" +%token COMP "~" + +;; ----------------- +;; Literal terminals +;; ----------------- +%type ;;syntax "\\(\\sw\\|\\s_\\)+" +%token IDENTIFIER + +%type ;;syntax "\\s\"" matchdatatype sexp +%token STRING_LITERAL + +%type ;;syntax semantic-lex-number-expression +%token NUMBER_LITERAL + +%type syntax "\\\\u[0-9a-f][0-9a-f][0-9a-f][0-9a-f]" +%token unicodecharacter + +;; ----------------- +;; Keyword terminals +;; ----------------- + +;; Generate a keyword analyzer +%type ;;syntax "\\(\\sw\\|\\s_\\)+" matchdatatype keyword + +%keyword ABSTRACT "abstract" +%put ABSTRACT summary +"Class|Method declaration modifier: abstract {class|} ..." + +%keyword BOOLEAN "boolean" +%put BOOLEAN summary +"Primitive logical quantity type (true or false)" + +%keyword BREAK "break" +%put BREAK summary +"break [