From: "Andreas Wieweg" <andreas.wieweg@obbit.se>
Subject: JFlex mode for FSF-Emacs ?
Date: Wed, 22 Jan 2003 16:24:29 +0100 [thread overview]
Message-ID: <034001c2c22a$5e125570$6500a8c0@manticora> (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)
next reply other threads:[~2003-01-22 15:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-22 15:24 Andreas Wieweg [this message]
[not found] <mailman.781.1043249234.21513.help-gnu-emacs@gnu.org>
2003-01-22 16:22 ` JFlex mode for FSF-Emacs ? 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>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='034001c2c22a$5e125570$6500a8c0@manticora' \
--to=andreas.wieweg@obbit.se \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).