emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Compiled files without sources????


From: Chong Yidong
Subject: Re: Compiled files without sources????
Date: Sun, 31 Jul 2011 20:14:37 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

David Engster <address@hidden> writes:

>> So what would be entailed to let upstream CEDET generate compiled
>> grammars directly usable in Emacs?  Why don't they work out of the box
>> when the parser runtime is ostensibly what is present in upstream
>> CEDET?  Can the differences be factored out into variables?
>
> The most important change is the 8+3 file renaming; this is replicated
> in the file-rename branch. Also, the CEDET compilation process was
> complicated and dependant on autoloads from EIEIO classes and methods,
> which Emacs doesn't support and which therefore was also removed; Lluís
> has written a completely new Makefile for that.

It's actually not as complicated as that.  The major changes between the
compiled grammars and the files actually included in Emacs are (i)
renaming of the files, (ii) fixed-up copyright headers, (iii) changes in
the `feature' keyword of the file plus the filename, and (iv)
re-ordering of some code chunks in the file to avoid some byte
compilation warnings (IIRC).  These changes are not really practical to
do except by hand.

Here is an example, comparing the compiled from etc/grammars/make.by to
lisp/cedet/semantic/bovine/make-by.el on the trunk.  (The bovine parser
generator is currently broken on the trunk, because of a bug related to
the "backquote not followed by a space" change, so generation was
actually done with Emacs 23.)


*** trunk/etc/grammars/semantic-make-by.el      2011-07-31 19:58:28.774752136 
-0400
--- trunk/lisp/cedet/semantic/bovine/make-by.el 2011-07-30 20:08:50.987784021 
-0400
***************
*** 1,36 ****
! ;;; semantic-make-by.el --- Generated parser support file
  
! ;; Copyright (C) 1999-2011 Free Software Foundation, Inc.
  
! ;; Author: Chong Yidong <address@hidden>
! ;; Created: 2011-07-31 19:58:28-0400
! ;; Keywords: syntax
! ;; X-RCS: $Id$
  
! ;; 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 3 of
! ;; the License, 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 this program.  If not, see <http://www.gnu.org/licenses/>.
  
  ;;; Commentary:
  ;;
! ;; PLEASE DO NOT MANUALLY EDIT THIS FILE!  It is automatically
! ;; generated from the grammar file make.by.
! 
! ;;; History:
! ;;
  
  ;;; Code:

  ;;; Prologue
  ;;
--- 1,31 ----
! ;;; semantic/bovine/make-by.el --- Generated parser support file
  
! ;; Copyright (C) 1999-2004, 2008-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 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 <http://www.gnu.org/licenses/>.
  
  ;;; Commentary:
  ;;
! ;; This file was generated from etc/grammars/make.by.
  
  ;;; Code:
+ 
+ (require 'semantic/lex)
+ (eval-when-compile (require 'semantic/bovine))
+ 

  ;;; Prologue
  ;;
***************
*** 70,76 ****
  
  (defconst semantic-make-by--parse-table
    `(
!     (bovine-toplevel 
       (Makefile)
       ) ;; end bovine-toplevel
  
--- 65,71 ----
  
  (defconst semantic-make-by--parse-table
    `(
!     (bovine-toplevel
       (Makefile)
       ) ;; end bovine-toplevel
  
***************
*** 385,399 ****
        semantic-flex-keywords-obarray semantic-make-by--keyword-table
        ))
  
!
! ;;; Analyzers
! ;;
! (require 'semantic-lex)
! 
!
! ;;; Epilogue
! ;;
! 
! (provide 'semantic-make-by)
  
! ;;; semantic-make-by.el ends here
--- 380,385 ----
        semantic-flex-keywords-obarray semantic-make-by--keyword-table
        ))
  
! (provide 'semantic/bovine/make-by)
  
! ;;; semantic/bovine/make-by.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]