From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Andreas Wieweg" Newsgroups: gmane.emacs.help Subject: Re: JFlex mode for FSF-Emacs ? Date: Wed, 22 Jan 2003 20:04:57 +0100 Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <002701c2c249$289accf0$6500a8c0@manticora> References: <5ld6mpb1dg.fsf@rum.cs.yale.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1043262567 21661 80.91.224.249 (22 Jan 2003 19:09:27 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 22 Jan 2003 19:09:27 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18bQFG-0005bz-00 for ; Wed, 22 Jan 2003 20:09:06 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18bQEY-0005kp-00 for gnu-help-gnu-emacs@m.gmane.org; Wed, 22 Jan 2003 14:08:22 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18bQDR-0004rC-00 for help-gnu-emacs@gnu.org; Wed, 22 Jan 2003 14:07:13 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18bQDK-0004kk-00 for help-gnu-emacs@gnu.org; Wed, 22 Jan 2003 14:07:07 -0500 Original-Received: from mail.goteborg.bonet.se ([212.181.52.4] helo=mail.g.bonet.se) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18bQBp-0004HN-00 for help-gnu-emacs@gnu.org; Wed, 22 Jan 2003 14:05:33 -0500 Original-Received: from manticora (as14-2-5.mal.s.bonet.se [217.215.191.63]) by mail.g.bonet.se (8.12.6/8.12.6) with SMTP id h0MJ06mt004130 for ; Wed, 22 Jan 2003 20:00:35 +0100 (CET) (envelope-from andreas.wieweg@obbit.se) Original-To: X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2720.3000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:5878 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:5878 > >>>>> "Andreas" == Andreas Wieweg writes: > > Why doesn't it work for Emacs 21.2 ? > > If things don't work in Emacs-21.2 it's because there's a problem. > Try to fix it and things will then work, > > PS: of course, we could provide a more specific diagnosis if you > could give us a more specific description of "doesn't work". I'm sorry. I didn't realise I didn't give enough information. *** A try at giving a more specific description: *** The jflex-mode should for jflex-files do: "Syntax highlighting (with font-lock) for JFlex keywords and Java actions " However there is almost no syntax-highligting when using FSF-Emacs, only comments and strings are highlighted. I thought that maybe some function/variable was used in the code, and that it was obvious for experienced emacs-lisp users that the function/variable was a XEmacs function/variable. But maybe it isn't that easy and takes more time and effort. I would like to fix it but I don't know where start looking. So any pointers and clues about what may be wrong (why the syntax-highlighting doesn't work) are very welcome! Hopefully this is a somewhat more specific description of "doesn't work" :) Regards / Andreas Wieweg *** A small example jflex file (expr.flex) *** /* A small calculator example */ import java_cup.runtime.*; class Yytoken extends Symbol { Yytoken(int token, Object obj) { super(token,obj); } Yytoken(int token) { super(token); } } %% %eofval { return (new Yytoken(sym.EOF)); %eofval } NONNEWLINE_WHITE_SPACE_CHAR=[\ \t\b\012] DIGIT=[0-9] NUMBER={DIGIT}+ %% {NONNEWLINE_WHITE_SPACE_CHAR}+ {;} "(" {return new Yytoken(sym.LPAREN);} ")" {return new Yytoken(sym.RPAREN);} ";" {return new Yytoken(sym.SEMI);} "+" {return new Yytoken(sym.PLUS);} "-" {return new Yytoken(sym.MINUS);} "*" {return new Yytoken(sym.TIMES);} "/" {return new Yytoken(sym.DIVIDE);} "%" {return new Yytoken(sym.MOD);} "^" {return new Yytoken(sym.MACHT);} {NUMBER} {return new Yytoken(sym.NUMBER,new Integer(yytext()));} .|\n {;}