I'm using jflex and i have to recognize characters, which can be:
- Normal chars, like 'a'
- Numbers, like '\126'
I've made this regular expression (Integer is a macro already defined):
Character = (\'.\')|(\'\\{Integer}\')
I don't know if it's ok, but my real problem is that i don't know what code i have to put to turn both type of strings into Characters, because this doesn't work:
{Character} { this.yylval = new Character(yytext());
return Parser.CHARACTER; }
Any idea?