[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: JFlex mode for FSF-Emacs ?
From: |
Andreas Wieweg |
Subject: |
Re: JFlex mode for FSF-Emacs ? |
Date: |
Wed, 22 Jan 2003 20:04:57 +0100 |
> >>>>> "Andreas" == Andreas Wieweg <andreas.wieweg@obbit.se> 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 {;}