// This JLex file was machine-generated by the BNF converter package se.chalmers.cs.gf.SyntaxTree; import java_cup.runtime.*; %% %cup %unicode %line %public %{ String pstring = new String(); public int line_num() { return (yyline+1); } public String buff() { return new String(yy_buffer,yy_buffer_index,10).trim(); } %} LETTER = ({CAPITAL}|{SMALL}) CAPITAL = [A-Z\xC0-\xD6\xD8-\xDE] SMALL = [a-z\xDF-\xF6\xF8-\xFF] DIGIT = [0-9] IDENT = ({LETTER}|{DIGIT}|['_]) %state COMMENT %state CHAR %state CHARESC %state CHAREND %state STRING %state ESCAPED %% \( { return new Symbol(sym._SYMB_0); } \) { return new Symbol(sym._SYMB_1); } "\"" { yybegin(STRING); } \\ { yybegin(ESCAPED); } \" { String foo = pstring; pstring = new String(); yybegin(YYINITIAL); return new Symbol(sym._STRING_, foo); } . { pstring += yytext(); } n { pstring += "\n"; yybegin(STRING); } \" { pstring += "\""; yybegin(STRING); } \\ { pstring += "\\"; yybegin(STRING); } t { pstring += "\t"; yybegin(STRING); } . { pstring += yytext(); yybegin(STRING); } {DIGIT}+ { return new Symbol(sym._INTEGER_, new Integer(yytext())); } {LETTER}{IDENT}* { return new Symbol(sym._IDENT_, new String(yytext())); } [ \t\r\n\f] { /* ignore white space. */ }