Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Lexical Scanner

Name: Anonymous 2009-05-13 5:26

Sup expert programmers. My task is to write a .lex file for jflex in order to generate a lexical scanner. I have everything ready, except for the declarations of IDENT and NUMBER:

ALPHA=[A-Za-z]
DIGIT=[0-9]

({ALPHA}({DIGIT}|{ALPHA})*)   { value = /* ? */ return TokenType.IDENT; }
({DIGIT}+)                    { value = /* ? */ return TokenType.NUMBER; }


As you can see, I don't know how I should assign a value to ident and number. The task is: Ident should have its name as a String as the value and Number should have its own int value as a value. How would I go about doing this?

Name: Anonymous 2009-05-13 6:23

>>4
Maybe, but maybe not.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List