scan.l - The First Step Detect a pattern and return a token for Yacc to chew on. Straightforward. (...) "for" { count(); return(FOR); } "goto" { count(); return(GOTO); } "if" { count(); return(IF); } "int" { count(); return(INT); } "long" { count(); return(LONG); } "return" { count(); return(RETURN); } "void" { count(); return(VOID); } "while" { count(); return(WHILE); } "..." { count(); return(VAR_ARGS); } /* CAUTION! varargs */ [1-9]{D}*{IS}? { count(); yylval.val = const_v(yytext); return(CONSTANT); } L?\"(\\.|[^\\"])*\" { count(); yylval.val = str_val(yytext);return(STRING_LITERAL); }