+ fun newString yyp = ( inString := true; stringPos := yyp; stringAcc := [] )
+ fun endString yyp = ( Tokens.STRING (concat (rev (!stringAcc)), !stringPos, yyp+1) )
+ fun addString yyt = ( inString := false; stringAcc := yyt :: (!stringAcc) )
<INITIAL> "else" => (Tokens.ELSE (yypos, yypos + size yytext));
<INITIAL> "var" => (Tokens.VAR (yypos, yypos + size yytext));
<INITIAL> "int" => (Tokens.INT (yypos, yypos + size yytext));
<INITIAL> "else" => (Tokens.ELSE (yypos, yypos + size yytext));
<INITIAL> "var" => (Tokens.VAR (yypos, yypos + size yytext));
<INITIAL> "int" => (Tokens.INT (yypos, yypos + size yytext));
<INITIAL> "extern" => (Tokens.EXTERN (yypos, yypos + size yytext));
<INITIAL> "struct" => (Tokens.STRUCT (yypos, yypos + size yytext));
<INITIAL> "NULL" => (Tokens.NULL (yypos, yypos + size yytext));
<INITIAL> "extern" => (Tokens.EXTERN (yypos, yypos + size yytext));
<INITIAL> "struct" => (Tokens.STRUCT (yypos, yypos + size yytext));
<INITIAL> "NULL" => (Tokens.NULL (yypos, yypos + size yytext));
<INITIAL> . => (ErrorMsg.error (ParseState.ext (yypos,yypos))
("illegal character: \"" ^ yytext ^ "\"");
lex ());
<INITIAL> . => (ErrorMsg.error (ParseState.ext (yypos,yypos))
("illegal character: \"" ^ yytext ^ "\"");
lex ());
<COMMENT> "/*" => (enterComment yypos; lex());
<COMMENT> "*/" => (if exitComment () then YYBEGIN INITIAL else (); lex());
<COMMENT> \n => (ParseState.newline yypos; lex ());
<COMMENT> "/*" => (enterComment yypos; lex());
<COMMENT> "*/" => (if exitComment () then YYBEGIN INITIAL else (); lex());
<COMMENT> \n => (ParseState.newline yypos; lex ());
<COMMENT_LINE> \n => (ParseState.newline yypos; YYBEGIN INITIAL; lex());
<COMMENT_LINE> . => (lex());
<COMMENT_LINE> \n => (ParseState.newline yypos; YYBEGIN INITIAL; lex());
<COMMENT_LINE> . => (lex());