Skip to content

Instantly share code, notes, and snippets.

@mrluanma
Created June 7, 2010 03:39
Show Gist options
  • Select an option

  • Save mrluanma/428199 to your computer and use it in GitHub Desktop.

Select an option

Save mrluanma/428199 to your computer and use it in GitHub Desktop.
%{
int yylineno;
%}
%%
^(.*)\n printf("%4d\t%s", yylineno++, yytext);
%%
int yywrap(void) {
return 1;
}
int main(int argc, char *argv[]) {
yylex();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment