all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* JFlex mode for FSF-Emacs ?
@ 2003-01-22 15:24 Andreas Wieweg
  0 siblings, 0 replies; 6+ messages in thread
From: Andreas Wieweg @ 2003-01-22 15:24 UTC (permalink / raw)


Hi
The following mode only seems to work for XEmacs.
Why doesn't it work for FSF-Emacs 21.2 ?

If anybody could give me some pointers about what I
need to modify I would appreciate it very much !

Regards
/ Andreas Wieweg





; -*- Mode: Emacs-Lisp; -*-

;;;  jflex-mode

;;;  author: Gerwin Klein <lsf@jflex.de>
;;;  $Revision: 1.3 $, $Date: 2001/10/25 18:55:52 $

(require 'derived)

(define-derived-mode jflex-mode java-mode "JFlex"
  "Major mode for editing JFlex files"

  ;; set the indentation
  (setq c-basic-offset 2)

  (c-set-offset 'knr-argdecl-intro 0)
  (c-set-offset 'topmost-intro-cont 0)

  ;; remove auto and hungry anything
  (c-toggle-auto-hungry-state -1)
  (c-toggle-auto-state -1)
  (c-toggle-hungry-state -1)

  (use-local-map jflex-mode-map)

  ;; get rid of that damn electric-brace
  (define-key jflex-mode-map "{" 'self-insert-command)
  (define-key jflex-mode-map "}" 'self-insert-command)

  (define-key jflex-mode-map [tab] 'jflex-indent-command)

  )

(defalias 'jflex-indent-command 'c-indent-command)

(defconst jflex-font-lock-keywords
  (append
   '(
     ("^%%" . font-lock-reference-face)
     "^%{"
     "^%init{"
     "^%initthrow{"
     "^%eof{"
     "^%eofthrow{"
     "^%yylexthrow{"
     "^%eofval{"
     "^%}"
     "^%init}"
     "^%initthrow}"
     "^%eof}"
     "^%eofthrow}"
     "^%yylexthrow}"
     "^%eofval}"
     "^%standalone"
     "^%scanerror"
     "^%switch"
     "^%states" ; fixme: state identifiers
     "^%state"
     "^%s"
     "^%xstates"
     "^%xstate"
     "^%x"
     "^%char"
     "^%line"
     "^%column"
     "^%byaccj"
     "^%cupsym"
     "^%cupdebug"
     "^%cup"
     "^%eofclose"
     "^%class"
     "^%function"
     "^%type"
     "^%integer"
     "^%intwrap"
     "^%int"
     "^%yyeof"
     "^%notunix"
     "^%7bit"
     "^%full"
     "^%8bit"
     "^%unicode"
     "^%16bit"
     "^%caseless"
     "^%ignorecase"
     "^%implements"
     "^%extends"
     "^%public"
     "^%final"
     "^%abstract"
     "^%debug"
     "^%table"
     "^%pack"
     "^%include"
     "^%buffer"
     "^%initthrow"
     "^%eofthrow"
     "^%yylexthrow"
     "^%throws"
     ("%[%{}0-9a-zA-Z]+" . font-lock-warning-face) ; errors
     ("{[ \t]*[a-zA-Z][0-9a-zA-Z_]+[ \t]*}" . font-lock-variable-name-face)
; macro uses
     "<<EOF>>" ; special <<EOF>> symbol
     ("<[ \t]*[a-zA-Z][0-9a-zA-Z_]+[ \t]*\\(,[ \t]*[a-zA-Z][0-9a-zA-Z_]+[
\t]*\\)*>" . font-lock-type-face) ; lex state list
     )
   java-font-lock-keywords-2)
  "JFlex keywords for font-lock mode")

(put 'jflex-mode 'font-lock-defaults
  '(jflex-font-lock-keywords
    nil nil ((?_ . "w")) beginning-of-defun))

(provide 'jflex-mode)

^ permalink raw reply	[flat|nested] 6+ messages in thread
[parent not found: <mailman.781.1043249234.21513.help-gnu-emacs@gnu.org>]

end of thread, other threads:[~2003-01-23  6:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-22 15:24 JFlex mode for FSF-Emacs ? Andreas Wieweg
     [not found] <mailman.781.1043249234.21513.help-gnu-emacs@gnu.org>
2003-01-22 16:22 ` Stefan Monnier <foo@acm.com>
2003-01-22 19:04   ` Andreas Wieweg
     [not found]   ` <mailman.800.1043262475.21513.help-gnu-emacs@gnu.org>
2003-01-22 20:25     ` Stefan Monnier <foo@acm.com>
2003-01-23  6:44       ` Andreas Wieweg
2003-01-22 20:28 ` Stefan Monnier <foo@acm.com>

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.